neulab/docprompting-conala huggingface dataset:
tf.raw_ops.WriteImageSummary Writes an image summary.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.WriteImageSummary  
tf.raw_ops.WriteImageSummary(
    writer, step, tag, tensor, bad_color, max_images=3, name=None
)
 Writes image tensor at step with tag using summary writer. tensor is image with shape [height, width, channels].
 


 Args
  writer   A Tensor of type resource.  
  step   A Tensor of type int64.  
  tag   A Tensor of type string.  
  tensor   A Tensor. Must be one of the following types: uint8, float32, half.  
  bad_color   A Tensor of type uint8.  
  max_images   An optional int that is >= 1. Defaults to 3.  
  name   A name for the operation (optional).   
 


 Returns   The created Operation.
tf.raw_ops.WriteRawProtoSummary Writes a serialized proto summary.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.WriteRawProtoSummary  
tf.raw_ops.WriteRawProtoSummary(
    writer, step, tensor, name=None
)
 Writes tensor, a serialized proto at step using summary writer.
 


 Args
  writer   A Tensor of type resource.  
  step   A Tensor of type int64.  
  tensor   A Tensor of type string.  
  name   A name for the operation (optional).   
 


 Returns   The created Operation.
tf.raw_ops.WriteScalarSummary Writes a scalar summary.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.WriteScalarSummary  
tf.raw_ops.WriteScalarSummary(
    writer, step, tag, value, name=None
)
 Writes scalar value at step with tag using summary writer.
 


 Args
  writer   A Tensor of type resource.  
  step   A Tensor of type int64.  
  tag   A Tensor of type string.  
  value   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64.  
  name   A name for the operation (optional).   
 


 Returns   The created Operation.
tf.raw_ops.WriteSummary Writes a tensor summary.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.WriteSummary  
tf.raw_ops.WriteSummary(
    writer, step, tensor, tag, summary_metadata, name=None
)
 Writes tensor at step with tag using summary writer.
 


 Args
  writer   A Tensor of type resource.  
  step   A Tensor of type int64.  
  tensor   A Tensor.  
  tag   A Tensor of type string.  
  summary_metadata   A Tensor of type string.  
  name   A name for the operation (optional).   
 


 Returns   The created Operation.
tf.raw_ops.Xdivy Returns 0 if x == 0, and x / y otherwise, elementwise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.Xdivy  
tf.raw_ops.Xdivy(
    x, y, name=None
)

 


 Args
  x   A Tensor. Must be one of the following types: half, float32, float64, 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.raw_ops.Xlog1py Returns 0 if x == 0, and x * log1p(y) otherwise, elementwise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.Xlog1py  
tf.raw_ops.Xlog1py(
    x, y, name=None
)

 


 Args
  x   A Tensor. Must be one of the following types: half, float32, float64, 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.raw_ops.Xlogy Returns 0 if x == 0, and x * log(y) otherwise, elementwise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.Xlogy  
tf.raw_ops.Xlogy(
    x, y, name=None
)

 


 Args
  x   A Tensor. Must be one of the following types: half, float32, float64, 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.raw_ops.ZerosLike Returns a tensor of zeros with the same shape and type as x.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.ZerosLike  
tf.raw_ops.ZerosLike(
    x, name=None
)

 


 Args
  x   A Tensor. a tensor of type T.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.raw_ops.Zeta   Compute the Hurwitz zeta function \(\zeta(x, q)\).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.Zeta  
tf.raw_ops.Zeta(
    x, q, name=None
)
 The Hurwitz zeta function is defined as: \(\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}\)
 


 Args
  x   A Tensor. Must be one of the following types: float32, float64.  
  q   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.raw_ops.ZipDataset Creates a dataset that zips together input_datasets.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.ZipDataset  
tf.raw_ops.ZipDataset(
    input_datasets, output_types, output_shapes, name=None
)
 The elements of the resulting dataset are created by zipping corresponding elements from each of the input datasets. The size of the resulting dataset will match the size of the smallest input dataset, and no error will be raised if input datasets have different sizes.
 


 Args
  input_datasets   A list of at least 1 Tensor objects with type variant. List of N variant Tensors representing datasets to be zipped together.  
  output_types   A list of tf.DTypes that has length >= 1.  
  output_shapes   A list of shapes (each a tf.TensorShape or list of ints) that has length >= 1.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type variant.
tf.realdiv Returns x / y element-wise for real types.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.realdiv  
tf.realdiv(
    x, y, name=None
)
 If x and y are reals, this will return the floating-point division. 
Note: 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.recompute_grad     View source on GitHub    An eager-compatible version of recompute_grad.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.recompute_grad  
tf.recompute_grad(
    f
)
 For f(*args, **kwargs), this supports gradients with respect to args or kwargs, but kwargs are currently only supported in eager-mode. Note that for keras layer and model objects, this is handled automatically. Warning: If f was originally a tf.keras Model or Layer object, g will not be able to access the member variables of that object, because g returns through the wrapper function inner. When recomputing gradients through objects that inherit from keras, we suggest keeping a reference to the underlying object around for the purpose of accessing these variables.
 


 Args
  f   function f(*x) that returns a Tensor or sequence of Tensor outputs.   
 


 Returns   A function g that wraps f, but which recomputes f on the backwards pass of a gradient call.
tf.RegisterGradient     View source on GitHub    A decorator for registering the gradient function for an op type.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.RegisterGradient  
tf.RegisterGradient(
    op_type
)
 This decorator is only used when defining a new op type. For an op with m inputs and n outputs, the gradient function is a function that takes the original Operation and n Tensor objects (representing the gradients with respect to each output of the op), and returns m Tensor objects (representing the partial gradients with respect to each input of the op). For example, assuming that operations of type "Sub" take two inputs x and y, and return a single output x - y, the following gradient function would be registered: @tf.RegisterGradient("Sub")
def _sub_grad(unused_op, grad):
  return grad, tf.negative(grad)
 The decorator argument op_type is the string type of an operation. This corresponds to the OpDef.name field for the proto that defines the operation.
 


 Args
  op_type   The string type of an operation. This corresponds to the OpDef.name field for the proto that defines the operation.   
 


 Raises
  TypeError   If op_type is not string.    Methods __call__ View source 
__call__(
    f
)
 Registers the function f as gradient function for op_type.
tf.register_tensor_conversion_function     View source on GitHub    Registers a function for converting objects of base_type to Tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.register_tensor_conversion_function  
tf.register_tensor_conversion_function(
    base_type, conversion_func, priority=100
)
 The conversion function must have the following signature: def conversion_func(value, dtype=None, name=None, as_ref=False):
  # ...
 It must return a Tensor with the given dtype if specified. If the conversion function creates a new Tensor, it should use the given name if specified. All exceptions will be propagated to the caller. The conversion function may return NotImplemented for some inputs. In this case, the conversion process will continue to try subsequent conversion functions. If as_ref is true, the function must return a Tensor reference, such as a Variable. 
Note: The conversion functions will execute in order of priority, followed by order of registration. To ensure that a conversion function F runs before another conversion function G, ensure that F is registered with a smaller priority than G.

 


 Args
  base_type   The base type or tuple of base types for all objects that conversion_func accepts.  
  conversion_func   A function that converts instances of base_type to Tensor.  
  priority   Optional integer that indicates the priority for applying this conversion function. Conversion functions with smaller priority values run earlier than conversion functions with larger priority values. Defaults to 100.   
 


 Raises
  TypeError   If the arguments do not have the appropriate type.
tf.repeat     View source on GitHub    Repeat elements of input.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.repeat  
tf.repeat(
    input, repeats, axis=None, name=None
)
 See also tf.concat, tf.stack, tf.tile.
 


 Args
  input   An N-dimensional Tensor.  
  repeats   An 1-D int Tensor. The number of repetitions for each element. repeats is broadcasted to fit the shape of the given axis. len(repeats) must equal input.shape[axis] if axis is not None.  
  axis   An int. The axis along which to repeat values. By default (axis=None), use the flattened input array, and return a flat output array.  
  name   A name for the operation.   
 


 Returns   A Tensor which has the same shape as input, except along the given axis. If axis is None then the output array is flattened to match the flattened input array.  
 Example usage: 
repeat(['a', 'b', 'c'], repeats=[3, 0, 2], axis=0)
<tf.Tensor: shape=(5,), dtype=string,
numpy=array([b'a', b'a', b'a', b'c', b'c'], dtype=object)>
 
repeat([[1, 2], [3, 4]], repeats=[2, 3], axis=0)
<tf.Tensor: shape=(5, 2), dtype=int32, numpy=
array([[1, 2],
       [1, 2],
       [3, 4],
       [3, 4],
       [3, 4]], dtype=int32)>
 
repeat([[1, 2], [3, 4]], repeats=[2, 3], axis=1)
<tf.Tensor: shape=(2, 5), dtype=int32, numpy=
array([[1, 1, 2, 2, 2],
       [3, 3, 4, 4, 4]], dtype=int32)>
 
repeat(3, repeats=4)
<tf.Tensor: shape=(4,), dtype=int32, numpy=array([3, 3, 3, 3], dtype=int32)>
 
repeat([[1,2], [3,4]], repeats=2)
<tf.Tensor: shape=(8,), dtype=int32,
numpy=array([1, 1, 2, 2, 3, 3, 4, 4], dtype=int32)>
tf.required_space_to_batch_paddings     View source on GitHub    Calculate padding required to make block_shape divide input_shape.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.required_space_to_batch_paddings  
tf.required_space_to_batch_paddings(
    input_shape, block_shape, base_paddings=None, name=None
)
 This function can be used to calculate a suitable paddings argument for use with space_to_batch_nd and batch_to_space_nd.
 


 Args
  input_shape   int32 Tensor of shape [N].  
  block_shape   int32 Tensor of shape [N].  
  base_paddings   Optional int32 Tensor of shape [N, 2]. Specifies the minimum amount of padding to use. All elements must be >= 0. If not specified, defaults to 0.  
  name   string. Optional name prefix.   
 


 Returns   (paddings, crops), where: paddings and crops are int32 Tensors of rank 2 and shape [N, 2] 
    satisfying   paddings[i, 0] = base_paddings[i, 0]. 0 <= paddings[i, 1] - base_paddings[i, 1] < block_shapei % block_shape[i] == 0 crops[i, 0] = 0 crops[i, 1] = paddings[i, 1] - base_paddings[i, 1] 
   Raises: ValueError if called with incompatible shapes.
tf.reverse Reverses specific dimensions of a tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.manip.reverse, tf.compat.v1.reverse, tf.compat.v1.reverse_v2  
tf.reverse(
    tensor, axis, name=None
)
 NOTE tf.reverse has now changed behavior in preparation for 1.0. tf.reverse_v2 is currently an alias that will be deprecated before TF 1.0. Given a tensor, and a int32 tensor axis representing the set of dimensions of tensor to reverse. This operation reverses each dimension i for which there exists j s.t. axis[j] == i. tensor can have up to 8 dimensions. The number of dimensions specified in axis may be 0 or more entries. If an index is specified more than once, a InvalidArgument error is raised. For example: # tensor 't' is [[[[ 0,  1,  2,  3],
#                  [ 4,  5,  6,  7],
#                  [ 8,  9, 10, 11]],
#                 [[12, 13, 14, 15],
#                  [16, 17, 18, 19],
#                  [20, 21, 22, 23]]]]
# tensor 't' shape is [1, 2, 3, 4]

# 'dims' is [3] or 'dims' is [-1]
reverse(t, dims) ==> [[[[ 3,  2,  1,  0],
                        [ 7,  6,  5,  4],
                        [ 11, 10, 9, 8]],
                       [[15, 14, 13, 12],
                        [19, 18, 17, 16],
                        [23, 22, 21, 20]]]]

# 'dims' is '[1]' (or 'dims' is '[-3]')
reverse(t, dims) ==> [[[[12, 13, 14, 15],
                        [16, 17, 18, 19],
                        [20, 21, 22, 23]
                       [[ 0,  1,  2,  3],
                        [ 4,  5,  6,  7],
                        [ 8,  9, 10, 11]]]]

# 'dims' is '[2]' (or 'dims' is '[-2]')
reverse(t, dims) ==> [[[[8, 9, 10, 11],
                        [4, 5, 6, 7],
                        [0, 1, 2, 3]]
                       [[20, 21, 22, 23],
                        [16, 17, 18, 19],
                        [12, 13, 14, 15]]]]

 


 Args
  tensor   A Tensor. Must be one of the following types: uint8, int8, uint16, int16, int32, int64, bool, bfloat16, half, float32, float64, complex64, complex128, string. Up to 8-D.  
  axis   A Tensor. Must be one of the following types: int32, int64. 1-D. The indices of the dimensions to reverse. Must be in the range [-rank(tensor), rank(tensor)).  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as tensor.
tf.reverse_sequence     View source on GitHub    Reverses variable length slices. 
tf.reverse_sequence(
    input, seq_lengths, seq_axis=None, batch_axis=None, name=None
)
 This op first slices input along the dimension batch_axis, and for each slice i, reverses the first seq_lengths[i] elements along the dimension seq_axis. The elements of seq_lengths must obey seq_lengths[i] <= input.dims[seq_axis], and seq_lengths must be a vector of length input.dims[batch_axis]. The output slice i along dimension batch_axis is then given by input slice i, with the first seq_lengths[i] slices along dimension seq_axis reversed. Example usage: 
seq_lengths = [7, 2, 3, 5]
input = [[1, 2, 3, 4, 5, 0, 0, 0], [1, 2, 0, 0, 0, 0, 0, 0],
         [1, 2, 3, 4, 0, 0, 0, 0], [1, 2, 3, 4, 5, 6, 7, 8]]
output = tf.reverse_sequence(input, seq_lengths, seq_axis=1, batch_axis=0)
output
<tf.Tensor: shape=(4, 8), dtype=int32, numpy=
array([[0, 0, 5, 4, 3, 2, 1, 0],
       [2, 1, 0, 0, 0, 0, 0, 0],
       [3, 2, 1, 4, 0, 0, 0, 0],
       [5, 4, 3, 2, 1, 6, 7, 8]], dtype=int32)>

 


 Args
  input   A Tensor. The input to reverse.  
  seq_lengths   A Tensor. Must be one of the following types: int32, int64. 1-D with length input.dims(batch_axis) and max(seq_lengths) <= input.dims(seq_axis)  
  seq_axis   An int. The dimension which is partially reversed.  
  batch_axis   An optional int. Defaults to 0. The dimension along which reversal is performed.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as input.
tf.roll     View source on GitHub    Rolls the elements of a tensor along an axis.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.manip.roll, tf.compat.v1.roll  
tf.roll(
    input, shift, axis, name=None
)
 The elements are shifted positively (towards larger indices) by the offset of shift along the dimension of axis. Negative shift values will shift elements in the opposite direction. Elements that roll passed the last position will wrap around to the first and vice versa. Multiple shifts along multiple axes may be specified. For example: # 't' is [0, 1, 2, 3, 4]
roll(t, shift=2, axis=0) ==> [3, 4, 0, 1, 2]

# shifting along multiple dimensions
# 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]
roll(t, shift=[1, -2], axis=[0, 1]) ==> [[7, 8, 9, 5, 6], [2, 3, 4, 0, 1]]

# shifting along the same axis multiple times
# 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]
roll(t, shift=[2, -3], axis=[1, 1]) ==> [[1, 2, 3, 4, 0], [6, 7, 8, 9, 5]]

 


 Args
  input   A Tensor.  
  shift   A Tensor. Must be one of the following types: int32, int64. Dimension must be 0-D or 1-D. shift[i] specifies the number of places by which elements are shifted positively (towards larger indices) along the dimension specified by axis[i]. Negative shifts will roll the elements in the opposite direction.  
  axis   A Tensor. Must be one of the following types: int32, int64. Dimension must be 0-D or 1-D. axis[i] specifies the dimension that the shift shift[i] should occur. If the same axis is referenced more than once, the total shift for that axis will be the sum of all the shifts that belong to that axis.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as input.
Module: tf.saved_model Public API for tf.saved_model namespace. Modules experimental module: Public API for tf.saved_model.experimental namespace. Classes class Asset: Represents a file asset to hermetically include in a SavedModel. class LoadOptions: Options for loading a SavedModel. class SaveOptions: Options for saving to SavedModel. Functions contains_saved_model(...): Checks whether the provided export directory could contain a SavedModel. load(...): Load a SavedModel from export_dir. save(...): Exports the Trackable object obj to SavedModel format.
 


 Other Members
  ASSETS_DIRECTORY   'assets'  
  ASSETS_KEY   'saved_model_assets'  
  CLASSIFY_INPUTS   'inputs'  
  CLASSIFY_METHOD_NAME   'tensorflow/serving/classify'  
  CLASSIFY_OUTPUT_CLASSES   'classes'  
  CLASSIFY_OUTPUT_SCORES   'scores'  
  DEBUG_DIRECTORY   'debug'  
  DEBUG_INFO_FILENAME_PB   'saved_model_debug_info.pb'  
  DEFAULT_SERVING_SIGNATURE_DEF_KEY   'serving_default'  
  GPU   'gpu'  
  PREDICT_INPUTS   'inputs'  
  PREDICT_METHOD_NAME   'tensorflow/serving/predict'  
  PREDICT_OUTPUTS   'outputs'  
  REGRESS_INPUTS   'inputs'  
  REGRESS_METHOD_NAME   'tensorflow/serving/regress'  
  REGRESS_OUTPUTS   'outputs'  
  SAVED_MODEL_FILENAME_PB   'saved_model.pb'  
  SAVED_MODEL_FILENAME_PBTXT   'saved_model.pbtxt'  
  SAVED_MODEL_SCHEMA_VERSION   1  
  SERVING   'serve'  
  TPU   'tpu'  
  TRAINING   'train'  
  VARIABLES_DIRECTORY   'variables'  
  VARIABLES_FILENAME   'variables'
tf.saved_model.Asset Represents a file asset to hermetically include in a SavedModel.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.saved_model.Asset  
tf.saved_model.Asset(
    path
)
 A SavedModel can include arbitrary files, called assets, that are needed for its use. For example a vocabulary file used initialize a lookup table. When a trackable object is exported via tf.saved_model.save(), all the Assets reachable from it are copied into the SavedModel assets directory. Upon loading, the assets and the serialized functions that depend on them will refer to the correct filepaths inside the SavedModel directory. Example: filename = tf.saved_model.Asset("file.txt")

@tf.function(input_signature=[])
def func():
  return tf.io.read_file(filename)

trackable_obj = tf.train.Checkpoint()
trackable_obj.func = func
trackable_obj.filename = filename
tf.saved_model.save(trackable_obj, "/tmp/saved_model")

# The created SavedModel is hermetic, it does not depend on
# the original file and can be moved to another path.
tf.io.gfile.remove("file.txt")
tf.io.gfile.rename("/tmp/saved_model", "/tmp/new_location")

reloaded_obj = tf.saved_model.load("/tmp/new_location")
print(reloaded_obj.func())

 


 Attributes
  asset_path   A 0-D tf.string tensor with path to the asset.
tf.saved_model.contains_saved_model     View source on GitHub    Checks whether the provided export directory could contain a SavedModel. 
tf.saved_model.contains_saved_model(
    export_dir
)
 Note that the method does not load any data by itself. If the method returns false, the export directory definitely does not contain a SavedModel. If the method returns true, the export directory may contain a SavedModel but provides no guarantee that it can be loaded.
 


 Args
  export_dir   Absolute string path to possible export location. For example, '/my/foo/model'.   
 


 Returns   True if the export directory contains SavedModel files, False otherwise.
Module: tf.saved_model.experimental Public API for tf.saved_model.experimental namespace. Classes class VariablePolicy: Enum defining options for variable handling when saving.