neulab/docprompting-conala huggingface dataset:
tf.tpu.experimental.embedding.TableConfig Configuration data for one embedding table.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.tpu.experimental.embedding.TableConfig  
tf.tpu.experimental.embedding.TableConfig(
    vocabulary_size: int,
    dim: int,
    initializer: Optional[Callable[[Any], None]],
    optimizer: Optional[_Optimizer] = None,
    combiner: Text = 'mean',
    name: Optional[Text] = None
)
 This class holds the configuration data for a single embedding table. It is used as the table parameter of a tf.tpu.experimental.embedding.FeatureConfig. Multiple tf.tpu.experimental.embedding.FeatureConfig objects can use the same tf.tpu.experimental.embedding.TableConfig object. In this case a shared table will be created for those feature lookups. table_config_one = tf.tpu.experimental.embedding.TableConfig(
    vocabulary_size=...,
    dim=...)
table_config_two = tf.tpu.experimental.embedding.TableConfig(
    vocabulary_size=...,
    dim=...)
feature_config = {
    'feature_one': tf.tpu.experimental.embedding.FeatureConfig(
        table=table_config_one),
    'feature_two': tf.tpu.experimental.embedding.FeatureConfig(
        table=table_config_one),
    'feature_three': tf.tpu.experimental.embedding.FeatureConfig(
        table=table_config_two)}
embedding = tf.tpu.experimental.embedding.TPUEmbedding(
    feature_config=feature_config,
    batch_size=...
    optimizer=tf.tpu.experimental.embedding.Adam(0.1))
 The above configuration has 2 tables, and three features. The first two features will be looked up in the first table and the third feature will be looked up in the second table.
 


 Args
  vocabulary_size   Size of the table's vocabulary (number of rows).  
  dim   The embedding dimension (width) of the table.  
  initializer   A callable initializer taking one parameter, the shape of the variable that will be initialized. Will be called once per task, to initialize that task's shard of the embedding table. If not specified, defaults to truncated_normal_initializer with mean 0.0 and standard deviation 1/sqrt(dim).  
  optimizer   An optional instance of an optimizer parameters class, instance of one of tf.tpu.experimental.embedding.SGD, tf.tpu.experimental.embedding.Adagrad or tf.tpu.experimental.embedding.Adam. It set will override the global optimizer passed to tf.tpu.experimental.embedding.TPUEmbedding.  
  combiner   A string specifying how to reduce if there are multiple entries in a single row. Currently 'mean', 'sqrtn', 'sum' are supported, with 'mean' the default. 'sqrtn' often achieves good accuracy, in particular with bag-of-words columns. For more information, see tf.nn.embedding_lookup_sparse.  
  name   An optional string used to name the table. Useful for debugging.   
 


 Raises
  ValueError   if vocabulary_size is not a positive integer.  
  ValueError   if dim is not a positive integer.  
  ValueError   if initializer is specified and is not callable.  
  ValueError   if combiner is not supported.
tf.tpu.experimental.initialize_tpu_system     View source on GitHub    Initialize the TPU devices.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.tpu.experimental.initialize_tpu_system  
tf.tpu.experimental.initialize_tpu_system(
    cluster_resolver=None
)

 


 Args
  cluster_resolver   A tf.distribute.cluster_resolver.TPUClusterResolver, which provides information about the TPU cluster.   
 


 Returns   The tf.tpu.Topology object for the topology of the TPU cluster. If called inside tf.function, it returns the serialized topology object instead.  

 


 Raises
  RuntimeError   If running inside a tf.function.  
  NotFoundError   If no TPU devices found in eager mode.
tf.tpu.experimental.shutdown_tpu_system Shuts down the TPU devices.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.tpu.experimental.shutdown_tpu_system  
tf.tpu.experimental.shutdown_tpu_system(
    cluster_resolver=None
)
 This will clear all caches, even those that are maintained through sequential calls to tf.tpu.experimental.initialize_tpu_system, such as the compilation cache.
 


 Args
  cluster_resolver   A tf.distribute.cluster_resolver.TPUClusterResolver, which provides information about the TPU cluster.   
 


 Raises
  RuntimeError   If no TPU devices found for eager execution or if run in a tf.function.
tf.tpu.experimental.Topology Describes a set of TPU devices.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.tpu.experimental.Topology  
tf.tpu.experimental.Topology(
    serialized=None, mesh_shape=None, device_coordinates=None
)
 Represents both the shape of the physical mesh, and the mapping between TensorFlow TPU devices to physical mesh coordinates.
 


 Args
  serialized   A serialized TopologyProto, or None. If not None, the serialized proto is parsed to discover the topology.  
  mesh_shape   A sequence of 4 positive integers, or None. If not None, the shape of the TPU topology, in number of cores. Ignored if serialized is not None.  
  device_coordinates   A rank 4 numpy array that describes the mapping from TensorFlow TPU devices to TPU fabric coordinates, or None. Ignored if serialized is notNone`.   
 


 Raises
  ValueError   If serialized does not describe a well-formed topology.  
  ValueError   If serialized is None and mesh_shape is not a sequence of 4 positive integers.  
  ValueError   If serialized is None and device_coordinates is not a rank 4 numpy int32 array that describes a valid coordinate mapping.   
 


 Attributes
  device_coordinates   Describes the mapping from TPU devices to topology coordinates.  
  mesh_rank   Returns the number of dimensions in the mesh.  
  mesh_shape   A rank 1 int32 array describing the shape of the TPU topology.  
  missing_devices   Array of indices of missing devices.  
  num_tasks   Returns the number of TensorFlow tasks in the TPU slice.  
  num_tpus_per_task   Returns the number of TPU devices per task in the TPU slice.    Methods cpu_device_name_at_coordinates View source 
cpu_device_name_at_coordinates(
    device_coordinates, job=None
)
 Returns the CPU device attached to a logical core. serialized View source 
serialized()
 Returns the serialized form of the topology. task_ordinal_at_coordinates View source 
task_ordinal_at_coordinates(
    device_coordinates
)
 Returns the TensorFlow task number attached to device_coordinates.
 


 Args
  device_coordinates   An integer sequence describing a device's physical coordinates in the TPU fabric.   
 


 Returns   Returns the TensorFlow task number that contains the TPU device with those physical coordinates.  
 tpu_device_name_at_coordinates View source 
tpu_device_name_at_coordinates(
    device_coordinates, job=None
)
 Returns the name of the TPU device assigned to a logical core. tpu_device_ordinal_at_coordinates View source 
tpu_device_ordinal_at_coordinates(
    device_coordinates
)
 Returns the TensorFlow device number at device_coordinates.
 


 Args
  device_coordinates   An integer sequence describing a device's physical coordinates in the TPU fabric.   
 


 Returns   Returns the TensorFlow device number within the task corresponding to attached to the device with those physical coordinates.
tf.tpu.experimental.TPUSystemMetadata Describes some metadata about the TPU system.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.tpu.experimental.TPUSystemMetadata  
tf.tpu.experimental.TPUSystemMetadata(
    num_cores, num_hosts, num_of_cores_per_host, topology, devices
)

 


 Attributes
  num_cores   interger. Total number of TPU cores in the TPU system.  
  num_hosts   interger. Total number of hosts (TPU workers) in the TPU system.  
  num_of_cores_per_host   interger. Number of TPU cores per host (TPU worker).  
  topology   an instance of tf.tpu.experimental.Topology, which describes the physical topology of TPU system.  
  devices   a tuple of strings, which describes all the TPU devices in the system.
Module: tf.train Support for training models. See the Training guide. Modules experimental module: Public API for tf.train.experimental namespace. Classes class BytesList: A ProtocolMessage class Checkpoint: Manages saving/restoring trackable values to disk. class CheckpointManager: Manages multiple checkpoints by keeping some and deleting unneeded ones. class CheckpointOptions: Options for constructing a Checkpoint. class ClusterDef: A ProtocolMessage class ClusterSpec: Represents a cluster as a set of "tasks", organized into "jobs". class Coordinator: A coordinator for threads. class Example: A ProtocolMessage class ExponentialMovingAverage: Maintains moving averages of variables by employing an exponential decay. class Feature: A ProtocolMessage class FeatureList: A ProtocolMessage class FeatureLists: A ProtocolMessage class Features: A ProtocolMessage class FloatList: A ProtocolMessage class Int64List: A ProtocolMessage class JobDef: A ProtocolMessage class SequenceExample: A ProtocolMessage class ServerDef: A ProtocolMessage Functions checkpoints_iterator(...): Continuously yield new checkpoint files as they appear. get_checkpoint_state(...): Returns CheckpointState proto from the "checkpoint" file. latest_checkpoint(...): Finds the filename of latest saved checkpoint file. list_variables(...): Lists the checkpoint keys and shapes of variables in a checkpoint. load_checkpoint(...): Returns CheckpointReader for checkpoint found in ckpt_dir_or_file. load_variable(...): Returns the tensor value of the given variable in the checkpoint.
tf.train.BytesList     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.BytesList 
 


 Attributes
  value   repeated bytes value
tf.train.CheckpointOptions Options for constructing a Checkpoint.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.CheckpointOptions  
tf.train.CheckpointOptions(
    experimental_io_device=None
)
 Used as the _options argument to the tf.Checkpoint constructor to adjust how variables are saved. Example: Run IO ops on "localhost" while saving a checkpoint: step = tf.Variable(0, name="step")
checkpoint = tf.Checkpoint(step=step)
options = tf.CheckpointOptions(experimental_io_device="/job:localhost")
checkpoint.save("/tmp/ckpt", options=options)

 


 Args
  experimental_io_device   string. Applies in a distributed setting. Tensorflow device to use to access the filesystem. If None (default) then for each variable the filesystem is accessed from the CPU:0 device of the host where that variable is assigned. If specified, the filesystem is instead accessed from that device for all variables. This is for example useful if you want to save to a local directory, such as "/tmp" when running in a distributed setting. In that case pass a device for the host where the "/tmp" directory is accessible. 
  
 


 Class Variables
  experimental_io_device
tf.train.checkpoints_iterator     View source on GitHub    Continuously yield new checkpoint files as they appear.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.checkpoints_iterator  
tf.train.checkpoints_iterator(
    checkpoint_dir, min_interval_secs=0, timeout=None, timeout_fn=None
)
 The iterator only checks for new checkpoints when control flow has been reverted to it. This means it can miss checkpoints if your code takes longer to run between iterations than min_interval_secs or the interval at which new checkpoints are written. The timeout argument is the maximum number of seconds to block waiting for a new checkpoint. It is used in combination with the timeout_fn as follows:  If the timeout expires and no timeout_fn was specified, the iterator stops yielding. If a timeout_fn was specified, that function is called and if it returns a true boolean value the iterator stops yielding. If the function returns a false boolean value then the iterator resumes the wait for new checkpoints. At this point the timeout logic applies again.  This behavior gives control to callers on what to do if checkpoints do not come fast enough or stop being generated. For example, if callers have a way to detect that the training has stopped and know that no new checkpoints will be generated, they can provide a timeout_fn that returns True when the training has stopped. If they know that the training is still going on they return False instead.
 


 Args
  checkpoint_dir   The directory in which checkpoints are saved.  
  min_interval_secs   The minimum number of seconds between yielding checkpoints.  
  timeout   The maximum number of seconds to wait between checkpoints. If left as None, then the process will wait indefinitely.  
  timeout_fn   Optional function to call after a timeout. If the function returns True, then it means that no new checkpoints will be generated and the iterator will exit. The function is called with no arguments.   
 


 Yields   String paths to latest checkpoint files as they arrive.
tf.train.ClusterDef     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.ClusterDef 
 


 Attributes
  job   repeated JobDef job
tf.train.Example     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.Example 
 


 Attributes
  features   Features features
Module: tf.train.experimental Public API for tf.train.experimental namespace. Classes class DynamicLossScale: Loss scale that dynamically adjusts itself. class FixedLossScale: Loss scale with a fixed value. class LossScale: Base class for all TF1 loss scales. class PythonState: A mixin for putting Python state in an object-based checkpoint. Functions disable_mixed_precision_graph_rewrite(...): Disables the mixed precision graph rewrite. (deprecated) enable_mixed_precision_graph_rewrite(...): Enable mixed precision via a graph rewrite. (deprecated)
tf.train.experimental.disable_mixed_precision_graph_rewrite     View source on GitHub    Disables the mixed precision graph rewrite. (deprecated) 
tf.train.experimental.disable_mixed_precision_graph_rewrite()
 Warning: THIS FUNCTION IS DEPRECATED. It will be removed after 2020-11-30. Instructions for updating: Use tf.keras.mixed_precision. There is a guide at https://www.tensorflow.org/guide/mixed_precision. Alternatively, tf.compat.v1.mixed_precision.disable_mixed_precision_graph_rewrite can be used, but this is not recommended for TF2 code. After this is called, the mixed precision graph rewrite will no longer run for tf.functions, and so float32 operations will no longer be converted to float16. This does not undo the effects of loss scaling. Any optimizers wrapped with a LossScaleOptimizer will continue to do loss scaling, although this loss scaling will no longer be useful, as the graph rewrite no longer converts tf.functions to use float16. This function is useful for unit testing. A unit test can test using the mixed precision graph rewrite, then disable it so future unit tests continue using float32.
tf.train.experimental.PythonState     View source on GitHub    A mixin for putting Python state in an object-based checkpoint.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.experimental.PythonState  This is an abstract class which allows extensions to TensorFlow's object-based checkpointing (see tf.train.Checkpoint). For example a wrapper for NumPy arrays: import io
import numpy

class NumpyWrapper(tf.train.experimental.PythonState):

  def __init__(self, array):
    self.array = array

  def serialize(self):
    string_file = io.BytesIO()
    try:
      numpy.save(string_file, self.array, allow_pickle=False)
      serialized = string_file.getvalue()
    finally:
      string_file.close()
    return serialized

  def deserialize(self, string_value):
    string_file = io.BytesIO(string_value)
    try:
      self.array = numpy.load(string_file, allow_pickle=False)
    finally:
      string_file.close()
 Instances of NumpyWrapper are checkpointable objects, and will be saved and restored from checkpoints along with TensorFlow state like variables. root = tf.train.Checkpoint(numpy=NumpyWrapper(numpy.array([1.])))
save_path = root.save(prefix)
root.numpy.array *= 2.
assert [2.] == root.numpy.array
root.restore(save_path)
assert [1.] == root.numpy.array
 Methods deserialize View source 
@abc.abstractmethod
deserialize(
    string_value
)
 Callback to deserialize the object. serialize View source 
@abc.abstractmethod
serialize()
 Callback to serialize the object. Returns a string.
tf.train.Feature     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.Feature 
 


 Attributes
  bytes_list   BytesList bytes_list  
  float_list   FloatList float_list  
  int64_list   Int64List int64_list
tf.train.FeatureList     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.FeatureList 
 


 Attributes
  feature   repeated Feature feature
tf.train.FeatureLists     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.FeatureLists 
 


 Attributes
  feature_list   repeated FeatureListEntry feature_list    Child Classes class FeatureListEntry
tf.train.FeatureLists.FeatureListEntry     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.FeatureLists.FeatureListEntry 
 


 Attributes
  key   string key  
  value   FeatureList value
tf.train.Features     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.Features 
 


 Attributes
  feature   repeated FeatureEntry feature    Child Classes class FeatureEntry
tf.train.Features.FeatureEntry     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.Features.FeatureEntry 
 


 Attributes
  key   string key  
  value   Feature value
tf.train.FloatList     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.FloatList 
 


 Attributes
  value   repeated float value
tf.train.get_checkpoint_state     View source on GitHub    Returns CheckpointState proto from the "checkpoint" file.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.get_checkpoint_state  
tf.train.get_checkpoint_state(
    checkpoint_dir, latest_filename=None
)
 If the "checkpoint" file contains a valid CheckpointState proto, returns it.
 


 Args
  checkpoint_dir   The directory of checkpoints.  
  latest_filename   Optional name of the checkpoint file. Default to 'checkpoint'.   
 


 Returns   A CheckpointState if the state was available, None otherwise.  

 


 Raises
  ValueError   if the checkpoint read doesn't have model_checkpoint_path set.
tf.train.Int64List     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.Int64List 
 


 Attributes
  value   repeated int64 value
tf.train.JobDef     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.JobDef 
 


 Attributes
  name   string name  
  tasks   repeated TasksEntry tasks    Child Classes class TasksEntry
tf.train.JobDef.TasksEntry     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.JobDef.TasksEntry 
 


 Attributes
  key   int32 key  
  value   string value
tf.train.latest_checkpoint     View source on GitHub    Finds the filename of latest saved checkpoint file.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.latest_checkpoint  
tf.train.latest_checkpoint(
    checkpoint_dir, latest_filename=None
)
 Gets the checkpoint state given the provided checkpoint_dir and looks for a corresponding TensorFlow 2 (preferred) or TensorFlow 1.x checkpoint path. The latest_filename argument is only applicable if you are saving checkpoint using v1.train.Saver.save See the Training Checkpoints Guide for more details and examples.`
 


 Args
  checkpoint_dir   Directory where the variables were saved.  
  latest_filename   Optional name for the protocol buffer file that contains the list of most recent checkpoint filenames. See the corresponding argument to v1.train.Saver.save.   
 


 Returns   The full path to the latest checkpoint or None if no checkpoint was found.
tf.train.list_variables     View source on GitHub    Lists the checkpoint keys and shapes of variables in a checkpoint.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.list_variables  
tf.train.list_variables(
    ckpt_dir_or_file
)
 Checkpoint keys are paths in a checkpoint graph. Example usage: 
import tensorflow as tf
import os
ckpt_directory = "/tmp/training_checkpoints/ckpt"
ckpt = tf.train.Checkpoint(optimizer=optimizer, model=model)
manager = tf.train.CheckpointManager(ckpt, ckpt_directory, max_to_keep=3)
train_and_checkpoint(model, manager)
tf.train.list_variables(manager.latest_checkpoint)

 


 Args
  ckpt_dir_or_file   Directory with checkpoints file or path to checkpoint.   
 


 Returns   List of tuples (key, shape).
tf.train.load_checkpoint     View source on GitHub    Returns CheckpointReader for checkpoint found in ckpt_dir_or_file.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.load_checkpoint  
tf.train.load_checkpoint(
    ckpt_dir_or_file
)
 If ckpt_dir_or_file resolves to a directory with multiple checkpoints, reader for the latest checkpoint is returned.
 


 Args
  ckpt_dir_or_file   Directory with checkpoints file or path to checkpoint file.   
 


 Returns   CheckpointReader object.  

 


 Raises
  ValueError   If ckpt_dir_or_file resolves to a directory with no checkpoints.
tf.train.load_variable     View source on GitHub    Returns the tensor value of the given variable in the checkpoint.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.load_variable  
tf.train.load_variable(
    ckpt_dir_or_file, name
)

 


 Args
  ckpt_dir_or_file   Directory with checkpoints file or path to checkpoint.  
  name   Name of the variable to return.   
 


 Returns   A numpy ndarray with a copy of the value of this variable.
tf.train.SequenceExample     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.SequenceExample 
 


 Attributes
  context   Features context  
  feature_lists   FeatureLists feature_lists
tf.train.ServerDef     View source on GitHub    A ProtocolMessage  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.train.ServerDef 
 


 Attributes
  cluster   ClusterDef cluster  
  cluster_device_filters   ClusterDeviceFilters cluster_device_filters  
  default_session_config   ConfigProto default_session_config  
  job_name   string job_name  
  port   int32 port  
  protocol   string protocol  
  task_index   int32 task_index