def __init__(self, loss_tensor, fail_on_nan_loss=True):
    'Initializes NanLoss monitor.\n\n    Args:\n      loss_tensor: `Tensor`, the loss tensor.\n      fail_on_nan_loss: `bool`, whether to raise exception when loss is NaN.\n    '
    self._loss_tensor = loss_tensor
    self._fail_on_nan_loss = fail_on_nan_loss
Initializes NanLoss monitor.

Args:
  loss_tensor: `Tensor`, the loss tensor.
  fail_on_nan_loss: `bool`, whether to raise exception when loss is NaN.
def __init__(self, loss_tensor, fail_on_nan_loss=True):
    'Initializes NanLoss monitor.\n\n    Args:\n      loss_tensor: `Tensor`, the loss tensor.\n      fail_on_nan_loss: `bool`, whether to raise exception when loss is NaN.\n    '
    self._loss_tensor = loss_tensor
    self._fail_on_nan_loss = fail_on_nan_loss