def __init__(self, tensors, every_n_iter=100):
    'Initializes a LoggingHook monitor.\n\n    Args:\n      tensors: `dict` of tag to tensors/names or\n          `iterable` of tensors/names.\n      every_n_iter: `int`, print every N iteration.\n\n    Raises:\n     ValueError: if `every_n_iter` is non-positive.\n    '
    if (every_n_iter <= 0):
        raise ValueError(('Invalid every_n_iter=%s.' % every_n_iter))
    if (not isinstance(tensors, dict)):
        tensors = {item: item for item in tensors}
    self._tensors = tensors
    self._every_n_iter = every_n_iter
Initializes a LoggingHook monitor.

Args:
  tensors: `dict` of tag to tensors/names or
      `iterable` of tensors/names.
  every_n_iter: `int`, print every N iteration.

Raises:
 ValueError: if `every_n_iter` is non-positive.
def __init__(self, tensors, every_n_iter=100):
    'Initializes a LoggingHook monitor.\n\n    Args:\n      tensors: `dict` of tag to tensors/names or\n          `iterable` of tensors/names.\n      every_n_iter: `int`, print every N iteration.\n\n    Raises:\n     ValueError: if `every_n_iter` is non-positive.\n    '
    if (every_n_iter <= 0):
        raise ValueError(('Invalid every_n_iter=%s.' % every_n_iter))
    if (not isinstance(tensors, dict)):
        tensors = {item: item for item in tensors}
    self._tensors = tensors
    self._every_n_iter = every_n_iter