neulab/docprompting-conala huggingface dataset:
tf.compat.v1.flags.validator A function decorator for defining a flag validator.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.app.flags.validator  
tf.compat.v1.flags.validator(
    flag_name, message='Flag validation failed',
    flag_values=_flagvalues.FLAGS
)
 Registers the decorated function as a validator for flag_name, e.g. @flags.validator('foo') def _CheckFoo(foo): ... See register_validator() for the specification of checker function.
 


 Args
  flag_name   str, name of the flag to be checked.  
  message   str, error text to be shown to the user if checker returns False. If checker raises flags.ValidationError, message from the raised error will be shown.  
  flag_values   flags.FlagValues, optional FlagValues instance to validate against.   
 


 Returns   A function decorator that registers its function argument as a validator.  

 


 Raises
  AttributeError   Raised when flag_name is not registered as a valid flag name.
tf.compat.v1.flags.WhitespaceSeparatedListParser Parser for a whitespace-separated list of strings. Inherits From: BaseListParser, ArgumentParser  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.app.flags.WhitespaceSeparatedListParser  
tf.compat.v1.flags.WhitespaceSeparatedListParser(
    comma_compat=False
)

 


 Args
  comma_compat   bool, whether to support comma as an additional separator. If False then only whitespace is supported. This is intended only for backwards compatibility with flags that used to be comma-separated.    Methods flag_type 
flag_type()
 See base class. parse 
parse(
    argument
)
 Parses argument as whitespace-separated list of strings. It also parses argument as comma-separated list of strings if requested.
 


 Args
  argument   string argument passed in the commandline.   
 


 Returns   [str], the parsed flag value.  

 


 Class Variables
  syntactic_help   ''
tf.compat.v1.floor_div Returns x // y element-wise. 
tf.compat.v1.floor_div(
    x, y, name=None
)
 
Note: floor_div supports broadcasting. More about broadcasting here

 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, uint16, int16, int32, int64, complex64, complex128.  
  y   A Tensor. Must have the same type as x.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.compat.v1.foldl foldl on the list of tensors unpacked from elems on dimension 0. 
tf.compat.v1.foldl(
    fn, elems, initializer=None, parallel_iterations=10, back_prop=True,
    swap_memory=False, name=None
)
 This foldl operator repeatedly applies the callable fn to a sequence of elements from first to last. The elements are made of the tensors unpacked from elems on dimension 0. The callable fn takes two tensors as arguments. The first argument is the accumulated value computed from the preceding invocation of fn, and the second is the value at the current position of elems. If initializer is None, elems must contain at least one element, and its first element is used as the initializer. Suppose that elems is unpacked into values, a list of tensors. The shape of the result tensor is fn(initializer, values[0]).shape`. This method also allows multi-arity elems and output of fn. If elems is a (possibly nested) list or tuple of tensors, then each of these tensors must have a matching first (unpack) dimension. The signature of fn may match the structure of elems. That is, if elems is (t1, [t2, t3, [t4, t5]]), then an appropriate signature for fn is: fn = lambda (t1, [t2, t3, [t4, t5]]):.
 


 Args
  fn   The callable to be performed.  
  elems   A tensor or (possibly nested) sequence of tensors, each of which will be unpacked along their first dimension. The nested sequence of the resulting slices will be the first argument to fn.  
  initializer   (optional) A tensor or (possibly nested) sequence of tensors, as the initial value for the accumulator.  
  parallel_iterations   (optional) The number of iterations allowed to run in parallel.  
  back_prop   (optional) True enables support for back propagation.  
  swap_memory   (optional) True enables GPU-CPU memory swapping.  
  name   (optional) Name prefix for the returned tensors.   
 


 Returns   A tensor or (possibly nested) sequence of tensors, resulting from applying fn consecutively to the list of tensors unpacked from elems, from first to last.  

 


 Raises
  TypeError   if fn is not callable.    Example: elems = tf.constant([1, 2, 3, 4, 5, 6])
sum = foldl(lambda a, x: a + x, elems)
# sum == 21
tf.compat.v1.foldr foldr on the list of tensors unpacked from elems on dimension 0. 
tf.compat.v1.foldr(
    fn, elems, initializer=None, parallel_iterations=10, back_prop=True,
    swap_memory=False, name=None
)
 This foldr operator repeatedly applies the callable fn to a sequence of elements from last to first. The elements are made of the tensors unpacked from elems. The callable fn takes two tensors as arguments. The first argument is the accumulated value computed from the preceding invocation of fn, and the second is the value at the current position of elems. If initializer is None, elems must contain at least one element, and its first element is used as the initializer. Suppose that elems is unpacked into values, a list of tensors. The shape of the result tensor is fn(initializer, values[0]).shape. This method also allows multi-arity elems and output of fn. If elems is a (possibly nested) list or tuple of tensors, then each of these tensors must have a matching first (unpack) dimension. The signature of fn may match the structure of elems. That is, if elems is (t1, [t2, t3, [t4, t5]]), then an appropriate signature for fn is: fn = lambda (t1, [t2, t3, [t4, t5]]):.
 


 Args
  fn   The callable to be performed.  
  elems   A tensor or (possibly nested) sequence of tensors, each of which will be unpacked along their first dimension. The nested sequence of the resulting slices will be the first argument to fn.  
  initializer   (optional) A tensor or (possibly nested) sequence of tensors, as the initial value for the accumulator.  
  parallel_iterations   (optional) The number of iterations allowed to run in parallel.  
  back_prop   (optional) True enables support for back propagation.  
  swap_memory   (optional) True enables GPU-CPU memory swapping.  
  name   (optional) Name prefix for the returned tensors.   
 


 Returns   A tensor or (possibly nested) sequence of tensors, resulting from applying fn consecutively to the list of tensors unpacked from elems, from last to first.  

 


 Raises
  TypeError   if fn is not callable.    Example: elems = [1, 2, 3, 4, 5, 6]
sum = foldr(lambda a, x: a + x, elems)
# sum == 21
tf.compat.v1.gather   Gather slices from params axis axis according to indices. 
tf.compat.v1.gather(
    params, indices, validate_indices=None, name=None, axis=None, batch_dims=0
)
 Gather slices from params axis axis according to indices. indices must be an integer tensor of any dimension (usually 0-D or 1-D). For 0-D (scalar) indices:  $$\begin{align*} output[p_0, ..., p_{axis-1}, && &&& p_{axis + 1}, ..., p_{N-1}] = \\ params[p_0, ..., p_{axis-1}, && indices, &&& p_{axis + 1}, ..., p_{N-1}] \end{align*}$$  Where N = ndims(params). For 1-D (vector) indices with batch_dims=0:  $$\begin{align*} output[p_0, ..., p_{axis-1}, && &i, &&p_{axis + 1}, ..., p_{N-1}] =\\ params[p_0, ..., p_{axis-1}, && indices[&i], &&p_{axis + 1}, ..., p_{N-1}] \end{align*}$$  In the general case, produces an output tensor where:  $$\begin{align*} output[p_0, &..., p_{axis-1}, & &i_{B}, ..., i_{M-1}, & p_{axis + 1}, &..., p_{N-1}] = \\ params[p_0, &..., p_{axis-1}, & indices[p_0, ..., p_{B-1}, &i_{B}, ..., i_{M-1}], & p_{axis + 1}, &..., p_{N-1}] \end{align*}$$  Where N = ndims(params), M = ndims(indices), and B = batch_dims. Note that params.shape[:batch_dims] must be identical to indices.shape[:batch_dims]. The shape of the output tensor is:  output.shape = params.shape[:axis] + indices.shape[batch_dims:] + params.shape[axis + 1:].  Note that on CPU, if an out of bound index is found, an error is returned. On GPU, if an out of bound index is found, a 0 is stored in the corresponding output value. See also tf.gather_nd.   
 


 Args
  params   The Tensor from which to gather values. Must be at least rank axis + 1.  
  indices   The index Tensor. Must be one of the following types: int32, int64. Must be in range [0, params.shape[axis]).  
  validate_indices   Deprecated, does nothing.  
  axis   A Tensor. Must be one of the following types: int32, int64. The axis in params to gather indices from. Must be greater than or equal to batch_dims. Defaults to the first non-batch dimension. Supports negative indexes.  
  batch_dims   An integer. The number of batch dimensions. Must be less than or equal to rank(indices).  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as params.
tf.compat.v1.get_collection Wrapper for Graph.get_collection() using the default graph. 
tf.compat.v1.get_collection(
    key, scope=None
)
 See tf.Graph.get_collection for more details.
 


 Args
  key   The key for the collection. For example, the GraphKeys class contains many standard names for collections.  
  scope   (Optional.) If supplied, the resulting list is filtered to include only items whose name attribute matches using re.match. Items without a name attribute are never returned if a scope is supplied and the choice or re.match means that a scope without special tokens filters by prefix.   
 


 Returns   The list of values in the collection with the given name, or an empty list if no value has been added to that collection. The list contains the values in the order under which they were collected.  
 Eager Compatibility Collections are not supported when eager execution is enabled.
tf.compat.v1.get_collection_ref Wrapper for Graph.get_collection_ref() using the default graph. 
tf.compat.v1.get_collection_ref(
    key
)
 See tf.Graph.get_collection_ref for more details.
 


 Args
  key   The key for the collection. For example, the GraphKeys class contains many standard names for collections.   
 


 Returns   The list of values in the collection with the given name, or an empty list if no value has been added to that collection. Note that this returns the collection list itself, which can be modified in place to change the collection.  
 Eager Compatibility Collections are not supported when eager execution is enabled.
tf.compat.v1.get_default_graph Returns the default graph for the current thread. 
tf.compat.v1.get_default_graph()
 The returned graph will be the innermost graph on which a Graph.as_default() context has been entered, or a global default graph if none has been explicitly created. 
Note: The default graph is a property of the current thread. If you create a new thread, and wish to use the default graph in that thread, you must explicitly add a with g.as_default(): in that thread's function.

 


 Returns   The default Graph being used in the current thread.
tf.compat.v1.get_default_session Returns the default session for the current thread. 
tf.compat.v1.get_default_session()
 The returned Session will be the innermost session on which a Session or Session.as_default() context has been entered. 
Note: The default session is a property of the current thread. If you create a new thread, and wish to use the default session in that thread, you must explicitly add a with sess.as_default(): in that thread's function.

 


 Returns   The default Session being used in the current thread.
tf.compat.v1.get_seed Returns the local seeds an operation should use given an op-specific seed.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.random.get_seed  
tf.compat.v1.get_seed(
    op_seed
)
 Given operation-specific seed, op_seed, this helper function returns two seeds derived from graph-level and op-level seeds. Many random operations internally use the two seeds to allow user to change the seed globally for a graph, or for only specific operations. For details on how the graph-level seed interacts with op seeds, see tf.compat.v1.random.set_random_seed.
 


 Args
  op_seed   integer.   
 


 Returns   A tuple of two integers that should be used for the local seed of this operation.
tf.compat.v1.get_session_handle Return the handle of data. 
tf.compat.v1.get_session_handle(
    data, name=None
)
 This is EXPERIMENTAL and subject to change. Keep data "in-place" in the runtime and create a handle that can be used to retrieve data in a subsequent run(). Combined with get_session_tensor, we can keep a tensor produced in one run call in place, and use it as the input in a future run call.
 


 Args
  data   A tensor to be stored in the session.  
  name   Optional name prefix for the return tensor.   
 


 Returns   A scalar string tensor representing a unique handle for data.  

 


 Raises
  TypeError   if data is not a Tensor.    Example: c = tf.multiply(a, b)
h = tf.compat.v1.get_session_handle(c)
h = sess.run(h)

p, a = tf.compat.v1.get_session_tensor(h.handle, tf.float32)
b = tf.multiply(a, 10)
c = sess.run(b, feed_dict={p: h.handle})
tf.compat.v1.get_session_tensor Get the tensor of type dtype by feeding a tensor handle. 
tf.compat.v1.get_session_tensor(
    handle, dtype, name=None
)
 This is EXPERIMENTAL and subject to change. Get the value of the tensor from a tensor handle. The tensor is produced in a previous run() and stored in the state of the session.
 


 Args
  handle   The string representation of a persistent tensor handle.  
  dtype   The type of the output tensor.  
  name   Optional name prefix for the return tensor.   
 


 Returns   A pair of tensors. The first is a placeholder for feeding a tensor handle and the second is the tensor in the session state keyed by the tensor handle.  
 Example: c = tf.multiply(a, b)
h = tf.compat.v1.get_session_handle(c)
h = sess.run(h)

p, a = tf.compat.v1.get_session_tensor(h.handle, tf.float32)
b = tf.multiply(a, 10)
c = sess.run(b, feed_dict={p: h.handle})
tf.compat.v1.get_variable_scope Returns the current variable scope. 
tf.compat.v1.get_variable_scope()
Module: tf.compat.v1.gfile Import router for file_io. Classes class FastGFile: File I/O wrappers without thread locking. class GFile: File I/O wrappers without thread locking. class Open: File I/O wrappers without thread locking. Functions Copy(...): Copies data from oldpath to newpath. DeleteRecursively(...): Deletes everything under dirname recursively. Exists(...): Determines whether a path exists or not. Glob(...): Returns a list of files that match the given pattern(s). IsDirectory(...): Returns whether the path is a directory or not. ListDirectory(...): Returns a list of entries contained within a directory. MakeDirs(...): Creates a directory and all parent/intermediate directories. MkDir(...): Creates a directory with the name dirname. Remove(...): Deletes the file located at 'filename'. Rename(...): Rename or move a file / directory. Stat(...): Returns file statistics for a given path. Walk(...): Recursive directory tree generator for directories.
tf.compat.v1.gfile.Copy Copies data from oldpath to newpath. 
tf.compat.v1.gfile.Copy(
    oldpath, newpath, overwrite=False
)

 


 Args
  oldpath   string, name of the file who's contents need to be copied  
  newpath   string, name of the file to which to copy to  
  overwrite   boolean, if false it's an error for newpath to be occupied by an existing file.   
 


 Raises
  errors.OpError   If the operation fails.
tf.compat.v1.gfile.DeleteRecursively Deletes everything under dirname recursively. 
tf.compat.v1.gfile.DeleteRecursively(
    dirname
)

 


 Args
  dirname   string, a path to a directory   
 


 Raises
  errors.OpError   If the operation fails.
tf.compat.v1.gfile.Exists Determines whether a path exists or not. 
tf.compat.v1.gfile.Exists(
    filename
)

 


 Args
  filename   string, a path   
 


 Returns   True if the path exists, whether it's a file or a directory. False if the path does not exist and there are no filesystem errors.  

 


 Raises
  errors.OpError   Propagates any errors reported by the FileSystem API.
tf.compat.v1.gfile.FastGFile File I/O wrappers without thread locking. 
tf.compat.v1.gfile.FastGFile(
    name, mode='r'
)
 Note, that this is somewhat like builtin Python file I/O, but there are semantic differences to make it more efficient for some backing filesystems. For example, a write mode file will not be opened until the first write call (to minimize RPC invocations in network filesystems).
 


 Attributes
  mode   Returns the mode in which the file was opened.  
  name   Returns the file name.    Methods close View source 
close()
 Closes FileIO. Should be called for the WritableFile to be flushed. flush View source 
flush()
 Flushes the Writable file. This only ensures that the data has made its way out of the process without any guarantees on whether it's written to disk. This means that the data would survive an application crash but not necessarily an OS crash. next View source 
next()
 read View source 
read(
    n=-1
)
 Returns the contents of a file as a string. Starts reading from current position in file.
 


 Args
  n   Read n bytes if n != -1. If n = -1, reads to end of file.   
 


 Returns   n bytes of the file (or whole file) in bytes mode or n bytes of the string if in string (regular) mode.  
 readline View source 
readline()
 Reads the next line, keeping \n. At EOF, returns ''. readlines View source 
readlines()
 Returns all lines from the file in a list. seek View source 
seek(
    offset=None, whence=0, position=None
)
 Seeks to the offset in the file. (deprecated arguments) Warning: SOME ARGUMENTS ARE DEPRECATED: (position). They will be removed in a future version. Instructions for updating: position is deprecated in favor of the offset argument.
 


 Args
  offset   The byte count relative to the whence argument.  
  whence   Valid values for whence are: 0: start of the file (default) 1: relative to the current position of the file 2: relative to the end of file. offset is usually negative.    seekable View source 
seekable()
 Returns True as FileIO supports random access ops of seek()/tell() size View source 
size()
 Returns the size of the file. tell View source 
tell()
 Returns the current position in the file. write View source 
write(
    file_content
)
 Writes file_content to the file. Appends to the end of the file. __enter__ View source 
__enter__()
 Make usable with "with" statement. __exit__ View source 
__exit__(
    unused_type, unused_value, unused_traceback
)
 Make usable with "with" statement. __iter__ View source 
__iter__()
tf.compat.v1.gfile.Glob Returns a list of files that match the given pattern(s). 
tf.compat.v1.gfile.Glob(
    filename
)

 


 Args
  filename   string or iterable of strings. The glob pattern(s).   
 


 Returns   A list of strings containing filenames that match the given pattern(s).  

 


 Raises
  errors.OpError: If there are filesystem / directory listing errors. errors.NotFoundError: If pattern to be matched is an invalid directory.
tf.compat.v1.gfile.IsDirectory Returns whether the path is a directory or not. 
tf.compat.v1.gfile.IsDirectory(
    dirname
)

 


 Args
  dirname   string, path to a potential directory   
 


 Returns   True, if the path is a directory; False otherwise
tf.compat.v1.gfile.ListDirectory Returns a list of entries contained within a directory. 
tf.compat.v1.gfile.ListDirectory(
    dirname
)
 The list is in arbitrary order. It does not contain the special entries "." and "..".
 


 Args
  dirname   string, path to a directory   
 


 Returns   [filename1, filename2, ... filenameN] as strings  

 


 Raises   errors.NotFoundError if directory doesn't exist
tf.compat.v1.gfile.MakeDirs Creates a directory and all parent/intermediate directories. 
tf.compat.v1.gfile.MakeDirs(
    dirname
)
 It succeeds if dirname already exists and is writable.
 


 Args
  dirname   string, name of the directory to be created   
 


 Raises
  errors.OpError   If the operation fails.
tf.compat.v1.gfile.MkDir Creates a directory with the name dirname. 
tf.compat.v1.gfile.MkDir(
    dirname
)

 


 Args
  dirname   string, name of the directory to be created    Notes: The parent directories need to exist. Use tf.io.gfile.makedirs instead if there is the possibility that the parent dirs don't exist.
 


 Raises
  errors.OpError   If the operation fails.
tf.compat.v1.gfile.Remove Deletes the file located at 'filename'. 
tf.compat.v1.gfile.Remove(
    filename
)

 


 Args
  filename   string, a filename   
 


 Raises
  errors.OpError   Propagates any errors reported by the FileSystem API. E.g., NotFoundError if the file does not exist.
tf.compat.v1.gfile.Rename Rename or move a file / directory. 
tf.compat.v1.gfile.Rename(
    oldname, newname, overwrite=False
)

 


 Args
  oldname   string, pathname for a file  
  newname   string, pathname to which the file needs to be moved  
  overwrite   boolean, if false it's an error for newname to be occupied by an existing file.   
 


 Raises
  errors.OpError   If the operation fails.
tf.compat.v1.gfile.Stat Returns file statistics for a given path. 
tf.compat.v1.gfile.Stat(
    filename
)

 


 Args
  filename   string, path to a file   
 


 Returns   FileStatistics struct that contains information about the path  

 


 Raises
  errors.OpError   If the operation fails.
tf.compat.v1.gfile.Walk Recursive directory tree generator for directories. 
tf.compat.v1.gfile.Walk(
    top, in_order=True
)

 


 Args
  top   string, a Directory name  
  in_order   bool, Traverse in order if True, post order if False. Errors that happen while listing directories are ignored.   
 


 Yields   Each yield is a 3-tuple: the pathname of a directory, followed by lists of all its subdirectories and leaf files. That is, each yield looks like: (dirname, [subdirname, subdirname, ...], [filename, filename, ...]). Each item is a string.
tf.compat.v1.global_variables Returns global variables. 
tf.compat.v1.global_variables(
    scope=None
)
 Global variables are variables that are shared across machines in a distributed environment. The Variable() constructor or get_variable() automatically adds new variables to the graph collection GraphKeys.GLOBAL_VARIABLES. This convenience function returns the contents of that collection. An alternative to global variables are local variables. See tf.compat.v1.local_variables
 


 Args
  scope   (Optional.) A string. If supplied, the resulting list is filtered to include only items whose name attribute matches scope using re.match. Items without a name attribute are never returned if a scope is supplied. The choice of re.match means that a scope without special tokens filters by prefix.   
 


 Returns   A list of Variable objects.
tf.compat.v1.global_variables_initializer Returns an Op that initializes global variables.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.initializers.global_variables  
tf.compat.v1.global_variables_initializer()
 This is just a shortcut for variables_initializer(global_variables())
 


 Returns   An Op that initializes global variables in the graph.
tf.compat.v1.GPUOptions A ProtocolMessage
 


 Attributes
  allocator_type   string allocator_type  
  allow_growth   bool allow_growth  
  deferred_deletion_bytes   int64 deferred_deletion_bytes  
  experimental   Experimental experimental  
  force_gpu_compatible   bool force_gpu_compatible  
  per_process_gpu_memory_fraction   double per_process_gpu_memory_fraction  
  polling_active_delay_usecs   int32 polling_active_delay_usecs  
  polling_inactive_delay_msecs   int32 polling_inactive_delay_msecs  
  visible_device_list   string visible_device_list    Child Classes class Experimental