def __init__(self,
               g=None,
               default_device=None,
               global_step=None):  # pylint: disable=redefined-outer-name
    """Creates a Bookkeeper.

    Args:
      g: A graph, if not specified then the default graph is used.
      default_device: A default device or function.
      global_step: A variable to use as a global step.
    Raises:
      ValueError: If global_step is not an integer variable.
    """
    if g is None:
      self._g = tf.get_default_graph()
    else:
      self._g = g
    self._train_op = None
    # List of summaries to collect.
    self._summary_tags = set()
    if global_step and global_step.dtype.base_dtype not in (tf.int32, tf.int64):
      raise ValueError('Global step must be an int32 or int64 variable: %s' %
                       global_step.dtype)
    self._global_step = global_step

    if default_device:
      # pylint: disable=protected-access
      self.g._device_function_stack.append(default_device)

    self._recurrent_state = None
    self.reset_summary_collections()
def __init__ ( self , g = None , default_device = None , global_step = None ) : if g is None : self . _g = tf . get_default_graph ( ) else : self . _g = g self . _train_op = None self . _summary_tags = set ( ) if global_step and global_step . dtype . base_dtype not in ( tf . int32 , tf . int64 ) : raise ValueError ( 'Global step must be an int32 or int64 variable: %s' % global_step . dtype ) self . _global_step = global_step if default_device : self . g . _device_function_stack . append ( default_device ) self . _recurrent_state = None self . reset_summary_collections ( )
Creates a Bookkeeper.

    Args:
      g: A graph, if not specified then the default graph is used.
      default_device: A default device or function.
      global_step: A variable to use as a global step.
    Raises:
      ValueError: If global_step is not an integer variable.