neulab/docprompting-conala huggingface dataset:
tf.estimator.SessionRunArgs Represents arguments to be added to a Session.run() call.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.estimator.SessionRunArgs, tf.compat.v1.train.SessionRunArgs  
tf.estimator.SessionRunArgs(
    fetches, feed_dict=None, options=None
)

 


 Args
  fetches   Exactly like the 'fetches' argument to Session.Run(). Can be a single tensor or op, a list of 'fetches' or a dictionary of fetches. For example: fetches = global_step_tensor fetches = [train_op, summary_op, global_step_tensor] fetches = {'step': global_step_tensor, 'summ': summary_op} Note that this can recurse as expected: fetches = {'step': global_step_tensor, 'ops': [train_op, check_nan_op]}  
  feed_dict   Exactly like the feed_dict argument to Session.Run()  
  options   Exactly like the options argument to Session.run(), i.e., a config_pb2.RunOptions proto.   
 


 Attributes
  fetches  
 
  feed_dict  
 
  options
tf.estimator.SessionRunContext Provides information about the session.run() call being made.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.estimator.SessionRunContext, tf.compat.v1.train.SessionRunContext  
tf.estimator.SessionRunContext(
    original_args, session
)
 Provides information about original request to Session.Run() function. SessionRunHook objects can stop the loop by calling request_stop() of run_context. In the future we may use this object to add more information about run without changing the Hook API.
 


 Attributes
  original_args   A SessionRunArgs object holding the original arguments of run(). If user called MonitoredSession.run(fetches=a, feed_dict=b), then this field is equal to SessionRunArgs(a, b). 
 
  session   A TensorFlow session object which will execute the run.  
  stop_requested   Returns whether a stop is requested or not. If true, MonitoredSession stops iterations. Returns: A bool 
   Methods request_stop View source 
request_stop()
 Sets stop requested field. Hooks can use this function to request stop of iterations. MonitoredSession checks whether this is called or not.
tf.estimator.SessionRunHook Hook to extend calls to MonitoredSession.run().  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.estimator.SessionRunHook, tf.compat.v1.train.SessionRunHook  Methods after_create_session View source 
after_create_session(
    session, coord
)
 Called when new TensorFlow session is created. This is called to signal the hooks that a new session has been created. This has two essential differences with the situation in which begin is called:  When this is called, the graph is finalized and ops can no longer be added to the graph. This method will also be called as a result of recovering a wrapped session, not only at the beginning of the overall session. 
 


 Args
  session   A TensorFlow Session that has been created.  
  coord   A Coordinator object which keeps track of all threads.    after_run View source 
after_run(
    run_context, run_values
)
 Called after each call to run(). The run_values argument contains results of requested ops/tensors by before_run(). The run_context argument is the same one send to before_run call. run_context.request_stop() can be called to stop the iteration. If session.run() raises any exceptions then after_run() is not called.
 


 Args
  run_context   A SessionRunContext object.  
  run_values   A SessionRunValues object.    before_run View source 
before_run(
    run_context
)
 Called before each call to run(). You can return from this call a SessionRunArgs object indicating ops or tensors to add to the upcoming run() call. These ops/tensors will be run together with the ops/tensors originally passed to the original run() call. The run args you return can also contain feeds to be added to the run() call. The run_context argument is a SessionRunContext that provides information about the upcoming run() call: the originally requested op/tensors, the TensorFlow Session. At this point graph is finalized and you can not add ops.
 


 Args
  run_context   A SessionRunContext object.   
 


 Returns   None or a SessionRunArgs object.  
 begin View source 
begin()
 Called once before using the session. When called, the default graph is the one that will be launched in the session. The hook can modify the graph by adding new operations to it. After the begin() call the graph will be finalized and the other callbacks can not modify the graph anymore. Second call of begin() on the same graph, should not change the graph. end View source 
end(
    session
)
 Called at the end of session. The session argument can be used in case the hook wants to run final ops, such as saving a last checkpoint. If session.run() raises exception other than OutOfRangeError or StopIteration then end() is not called. Note the difference between end() and after_run() behavior when session.run() raises OutOfRangeError or StopIteration. In that case end() is called but after_run() is not called.
 


 Args
  session   A TensorFlow Session that will be soon closed.
tf.estimator.SessionRunValues Contains the results of Session.run().  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.estimator.SessionRunValues, tf.compat.v1.train.SessionRunValues  
tf.estimator.SessionRunValues(
    results, options, run_metadata
)
 In the future we may use this object to add more information about result of run without changing the Hook API.
 


 Args
  results   The return values from Session.run() corresponding to the fetches attribute returned in the RunArgs. Note that this has the same shape as the RunArgs fetches. For example: fetches = global_step_tensor => results = nparray(int) fetches = [train_op, summary_op, global_step_tensor] => results = [None, nparray(string), nparray(int)] fetches = {'step': global_step_tensor, 'summ': summary_op} => results = {'step': nparray(int), 'summ': nparray(string)}  
  options   RunOptions from the Session.run() call.  
  run_metadata   RunMetadata from the Session.run() call.   
 


 Attributes
  results  
 
  options  
 
  run_metadata
tf.estimator.StepCounterHook Hook that counts steps per second. Inherits From: SessionRunHook  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.estimator.StepCounterHook, tf.compat.v1.train.StepCounterHook  
tf.estimator.StepCounterHook(
    every_n_steps=100, every_n_secs=None, output_dir=None, summary_writer=None
)
 Methods after_create_session View source 
after_create_session(
    session, coord
)
 Called when new TensorFlow session is created. This is called to signal the hooks that a new session has been created. This has two essential differences with the situation in which begin is called:  When this is called, the graph is finalized and ops can no longer be added to the graph. This method will also be called as a result of recovering a wrapped session, not only at the beginning of the overall session. 
 


 Args
  session   A TensorFlow Session that has been created.  
  coord   A Coordinator object which keeps track of all threads.    after_run View source 
after_run(
    run_context, run_values
)
 Called after each call to run(). The run_values argument contains results of requested ops/tensors by before_run(). The run_context argument is the same one send to before_run call. run_context.request_stop() can be called to stop the iteration. If session.run() raises any exceptions then after_run() is not called.
 


 Args
  run_context   A SessionRunContext object.  
  run_values   A SessionRunValues object.    before_run View source 
before_run(
    run_context
)
 Called before each call to run(). You can return from this call a SessionRunArgs object indicating ops or tensors to add to the upcoming run() call. These ops/tensors will be run together with the ops/tensors originally passed to the original run() call. The run args you return can also contain feeds to be added to the run() call. The run_context argument is a SessionRunContext that provides information about the upcoming run() call: the originally requested op/tensors, the TensorFlow Session. At this point graph is finalized and you can not add ops.
 


 Args
  run_context   A SessionRunContext object.   
 


 Returns   None or a SessionRunArgs object.  
 begin View source 
begin()
 Called once before using the session. When called, the default graph is the one that will be launched in the session. The hook can modify the graph by adding new operations to it. After the begin() call the graph will be finalized and the other callbacks can not modify the graph anymore. Second call of begin() on the same graph, should not change the graph. end View source 
end(
    session
)
 Called at the end of session. The session argument can be used in case the hook wants to run final ops, such as saving a last checkpoint. If session.run() raises exception other than OutOfRangeError or StopIteration then end() is not called. Note the difference between end() and after_run() behavior when session.run() raises OutOfRangeError or StopIteration. In that case end() is called but after_run() is not called.
 


 Args
  session   A TensorFlow Session that will be soon closed.
tf.estimator.TrainSpec     View source on GitHub    Configuration for the "train" part for the train_and_evaluate call.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.estimator.TrainSpec  
tf.estimator.TrainSpec(
    input_fn, max_steps=None, hooks=None, saving_listeners=None
)
 TrainSpec determines the input data for the training, as well as the duration. Optional hooks run at various stages of training. Usage: 
train_spec = tf.estimator.TrainSpec(
   input_fn=lambda: 1,
   max_steps=100,
   hooks=[_StopAtSecsHook(stop_after_secs=10)],
   saving_listeners=[_NewCheckpointListenerForEvaluate(None, 20, None)])
train_spec.saving_listeners[0]._eval_throttle_secs
20
train_spec.hooks[0]._stop_after_secs
10
train_spec.max_steps
100

 


 Args
  input_fn   A function that provides input data for training as minibatches. See Premade Estimators for more information. The function should construct and return one of the following:  A 'tf.data.Dataset' object: Outputs of Dataset object must be a tuple (features, labels) with same constraints as below. A tuple (features, labels): Where features is a Tensor or a dictionary of string feature name to Tensor and labels is a Tensor or a dictionary of string label name to Tensor. 

 
  max_steps   Int. Positive number of total steps for which to train model. If None, train forever. The training input_fn is not expected to generate OutOfRangeError or StopIteration exceptions. See the train_and_evaluate stop condition section for details.  
  hooks   Iterable of tf.train.SessionRunHook objects to run on all workers (including chief) during training.  
  saving_listeners   Iterable of tf.estimator.CheckpointSaverListener objects to run on chief during training.   
 


 Raises
  ValueError   If any of the input arguments is invalid.  
  TypeError   If any of the arguments is not of the expected type.   
 


 Attributes
  input_fn  
 
  max_steps  
 
  hooks  
 
  saving_listeners
tf.executing_eagerly     View source on GitHub    Checks whether the current thread has eager execution enabled. 
tf.executing_eagerly()
 Eager execution is enabled by default and this API returns True in most of cases. However, this API might return False in the following use cases.  Executing inside tf.function, unless under tf.init_scope or tf.config.run_functions_eagerly(True) is previously called. Executing inside a transformation function for tf.dataset. 
tf.compat.v1.disable_eager_execution() is called.  General case: 
print(tf.executing_eagerly())
True
 Inside tf.function: 
@tf.function
def fn():
  with tf.init_scope():
    print(tf.executing_eagerly())
  print(tf.executing_eagerly())
fn()
True
False
 Inside tf.function after tf.config.run_functions_eagerly(True) is called: 
tf.config.run_functions_eagerly(True)
@tf.function
def fn():
  with tf.init_scope():
    print(tf.executing_eagerly())
  print(tf.executing_eagerly())
fn()
True
True
tf.config.run_functions_eagerly(False)
 Inside a transformation function for tf.dataset: 
def data_fn(x):
  print(tf.executing_eagerly())
  return x
dataset = tf.data.Dataset.range(100)
dataset = dataset.map(data_fn)
False

 


 Returns   True if the current thread has eager execution enabled.
tf.expand_dims     View source on GitHub    Returns a tensor with a length 1 axis inserted at index axis. 
tf.expand_dims(
    input, axis, name=None
)
 Given a tensor input, this operation inserts a dimension of length 1 at the dimension index axis of input's shape. The dimension index follows Python indexing rules: It's zero-based, a negative index it is counted backward from the end. This operation is useful to:  Add an outer "batch" dimension to a single element. Align axes for broadcasting. To add an inner vector length axis to a tensor of scalars.  For example: If you have a single image of shape [height, width, channels]: 
image = tf.zeros([10,10,3])
 You can add an outer batch axis by passing axis=0: 
tf.expand_dims(image, axis=0).shape.as_list()
[1, 10, 10, 3]
 The new axis location matches Python list.insert(axis, 1): 
tf.expand_dims(image, axis=1).shape.as_list()
[10, 1, 10, 3]
 Following standard Python indexing rules, a negative axis counts from the end so axis=-1 adds an inner most dimension: 
tf.expand_dims(image, -1).shape.as_list()
[10, 10, 3, 1]
 This operation requires that axis is a valid index for input.shape, following Python indexing rules: -1-tf.rank(input) <= axis <= tf.rank(input)
 This operation is related to:  
tf.squeeze, which removes dimensions of size 1. 
tf.reshape, which provides more flexible reshaping capability. 
tf.sparse.expand_dims, which provides this functionality for tf.SparseTensor
 
 


 Args
  input   A Tensor.  
  axis   Integer specifying the dimension index at which to expand the shape of input. Given an input of D dimensions, axis must be in range [-(D+1), D] (inclusive).  
  name   Optional string. The name of the output Tensor.   
 


 Returns   A tensor with the same data as input, with an additional dimension inserted at the index specified by axis.  

 


 Raises
  ValueError   If axis is not specified.  
  InvalidArgumentError   If axis is out of range [-(D+1), D].
Module: tf.experimental Public API for tf.experimental namespace. Modules dlpack module: Public API for tf.experimental.dlpack namespace. numpy module: # tf.experimental.numpy: NumPy API on TensorFlow. tensorrt module: Public API for tf.experimental.tensorrt namespace. Classes class Optional: Represents a value that may or may not be present. Functions async_clear_error(...): Clear pending operations and error statuses in async execution. async_scope(...): Context manager for grouping async operations. function_executor_type(...): Context manager for setting the executor of eager defined functions. register_filesystem_plugin(...): Loads a TensorFlow FileSystem plugin.
tf.experimental.async_clear_error Clear pending operations and error statuses in async execution.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.experimental.async_clear_error  
tf.experimental.async_clear_error()
 In async execution mode, an error in op/function execution can lead to errors in subsequent ops/functions that are scheduled but not yet executed. Calling this method clears all pending operations and reset the async execution state. Example: while True:
  try:
    # Step function updates the metric `loss` internally
    train_step_fn()
  except tf.errors.OutOfRangeError:
    tf.experimental.async_clear_error()
    break
logging.info('loss = %s', loss.numpy())
tf.experimental.async_scope Context manager for grouping async operations.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.experimental.async_scope  
@tf_contextlib.contextmanager
tf.experimental.async_scope()
 Ops/function calls inside the scope can return before finishing the actual execution. When exiting the async scope, a synchronization barrier will be automatically added to ensure the completion of all async op and function execution, potentially raising exceptions if async execution results in an error state. Users may write the following code to asynchronuously invoke train_step_fn and log the loss metric for every num_steps steps in a training loop. train_step_fn internally consumes data using iterator.get_next(), and may throw OutOfRangeError when running out of data. In the case: try:
  with tf.experimental.async_scope():
    for _ in range(num_steps):
      # Step function updates the metric `loss` internally
      train_step_fn()
except tf.errors.OutOfRangeError:
  tf.experimental.async_clear_error()
logging.info('loss = %s', loss.numpy())

 


 Yields   Context manager for grouping async operations.
Module: tf.experimental.dlpack Public API for tf.experimental.dlpack namespace. Functions from_dlpack(...): Returns the Tensorflow eager tensor. to_dlpack(...): Returns the dlpack capsule representing the tensor.
tf.experimental.dlpack.from_dlpack Returns the Tensorflow eager tensor. 
tf.experimental.dlpack.from_dlpack(
    dlcapsule
)
 The returned tensor uses the memory shared by dlpack capsules from other framework. a = tf.experimental.dlpack.from_dlpack(dlcapsule)
# `a` uses the memory shared by dlpack

 


 Args
  dlcapsule   A PyCapsule named as dltensor   
 


 Returns   A Tensorflow eager tensor
tf.experimental.dlpack.to_dlpack Returns the dlpack capsule representing the tensor. 
tf.experimental.dlpack.to_dlpack(
    tf_tensor
)
 This operation ensures the underlying data memory is ready when returns. a = tf.tensor([1, 10])
dlcapsule = tf.experimental.dlpack.to_dlpack(a)
# dlcapsule represents the dlpack data structure

 


 Args
  tf_tensor   Tensorflow eager tensor, to be converted to dlpack capsule.   
 


 Returns   A PyCapsule named as dltensor, which shares the underlying memory to other framework. This PyCapsule can be consumed only once.
tf.experimental.function_executor_type     View source on GitHub    Context manager for setting the executor of eager defined functions.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.experimental.function_executor_type  
@tf_contextlib.contextmanager
tf.experimental.function_executor_type(
    executor_type
)
 Eager defined functions are functions decorated by tf.contrib.eager.defun.
 


 Args
  executor_type   a string for the name of the executor to be used to execute functions defined by tf.contrib.eager.defun.   
 


 Yields   Context manager for setting the executor of eager defined functions.
tf.experimental.numpy.abs TensorFlow variant of NumPy's abs. 
tf.experimental.numpy.abs(
    x
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.abs.
tf.experimental.numpy.absolute TensorFlow variant of NumPy's absolute. 
tf.experimental.numpy.absolute(
    x
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.absolute.
tf.experimental.numpy.add TensorFlow variant of NumPy's add. 
tf.experimental.numpy.add(
    x1, x2
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.add.
tf.experimental.numpy.all TensorFlow variant of NumPy's all. 
tf.experimental.numpy.all(
    a, axis=None, keepdims=None
)
 Unsupported arguments: out. See the NumPy documentation for numpy.all.
tf.experimental.numpy.allclose TensorFlow variant of NumPy's allclose. 
tf.experimental.numpy.allclose(
    a, b, rtol=1e-05, atol=1e-08, equal_nan=False
)
 See the NumPy documentation for numpy.allclose.
tf.experimental.numpy.amax TensorFlow variant of NumPy's amax. 
tf.experimental.numpy.amax(
    a, axis=None, keepdims=None
)
 Unsupported arguments: out, initial, where. See the NumPy documentation for numpy.amax.
tf.experimental.numpy.amin TensorFlow variant of NumPy's amin. 
tf.experimental.numpy.amin(
    a, axis=None, keepdims=None
)
 Unsupported arguments: out, initial, where. See the NumPy documentation for numpy.amin.
tf.experimental.numpy.angle TensorFlow variant of NumPy's angle. 
tf.experimental.numpy.angle(
    z, deg=False
)
 See the NumPy documentation for numpy.angle.
tf.experimental.numpy.any TensorFlow variant of NumPy's any. 
tf.experimental.numpy.any(
    a, axis=None, keepdims=None
)
 Unsupported arguments: out. See the NumPy documentation for numpy.any.
tf.experimental.numpy.append TensorFlow variant of NumPy's append. 
tf.experimental.numpy.append(
    arr, values, axis=None
)
 See the NumPy documentation for numpy.append.
tf.experimental.numpy.arange TensorFlow variant of NumPy's arange. 
tf.experimental.numpy.arange(
    start, stop=None, step=1, dtype=None
)
 Returns step-separated values in the range [start, stop). Args: start: Start of the interval. Included in the range. stop: End of the interval. If not specified, start is treated as 0 and start value is used as stop. If specified, it is not included in the range if step is integer. When step is floating point, it may or may not be included. step: The difference between 2 consecutive values in the output range. It is recommended to use linspace instead of using non-integer values for step. dtype: Optional. Type of the resulting ndarray. Could be a python type, a NumPy type or a TensorFlow DType. If not provided, the largest type of start, stop, step is used. Raises: ValueError: If step is zero. See the NumPy documentation for numpy.arange.
tf.experimental.numpy.arccos TensorFlow variant of NumPy's arccos. 
tf.experimental.numpy.arccos(
    x
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arccos.
tf.experimental.numpy.arccosh TensorFlow variant of NumPy's arccosh. 
tf.experimental.numpy.arccosh(
    x
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arccosh.
tf.experimental.numpy.arcsin TensorFlow variant of NumPy's arcsin. 
tf.experimental.numpy.arcsin(
    x
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arcsin.
tf.experimental.numpy.arcsinh TensorFlow variant of NumPy's arcsinh. 
tf.experimental.numpy.arcsinh(
    x
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arcsinh.
tf.experimental.numpy.arctan TensorFlow variant of NumPy's arctan. 
tf.experimental.numpy.arctan(
    x
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arctan.
tf.experimental.numpy.arctan2 TensorFlow variant of NumPy's arctan2. 
tf.experimental.numpy.arctan2(
    x1, x2
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arctan2.
tf.experimental.numpy.arctanh TensorFlow variant of NumPy's arctanh. 
tf.experimental.numpy.arctanh(
    x
)
 Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arctanh.
tf.experimental.numpy.argmax TensorFlow variant of NumPy's argmax. 
tf.experimental.numpy.argmax(
    a, axis=None
)
 Unsupported arguments: out. See the NumPy documentation for numpy.argmax.
tf.experimental.numpy.argmin TensorFlow variant of NumPy's argmin. 
tf.experimental.numpy.argmin(
    a, axis=None
)
 Unsupported arguments: out. See the NumPy documentation for numpy.argmin.
tf.experimental.numpy.argsort TensorFlow variant of NumPy's argsort. 
tf.experimental.numpy.argsort(
    a, axis=-1, kind='quicksort', order=None
)
 See the NumPy documentation for numpy.argsort.
tf.experimental.numpy.around TensorFlow variant of NumPy's around. 
tf.experimental.numpy.around(
    a, decimals=0
)
 Unsupported arguments: out. See the NumPy documentation for numpy.around.