neulab/docprompting-conala huggingface dataset:
tf.io.encode_jpeg JPEG-encode an image.  View aliases  Main aliases 
tf.image.encode_jpeg Compat aliases for migration See Migration guide for more details. tf.compat.v1.image.encode_jpeg, tf.compat.v1.io.encode_jpeg  
tf.io.encode_jpeg(
    image, format='', quality=95, progressive=False, optimize_size=False,
    chroma_downsampling=True, density_unit='in', x_density=300,
    y_density=300, xmp_metadata='', name=None
)
 image is a 3-D uint8 Tensor of shape [height, width, channels]. The attr format can be used to override the color format of the encoded output. Values can be:  
'': Use a default format based on the number of channels in the image. 
grayscale: Output a grayscale JPEG image. The channels dimension of image must be 1. 
rgb: Output an RGB JPEG image. The channels dimension of image must be 3.  If format is not specified or is the empty string, a default format is picked in function of the number of channels in image:  1: Output a grayscale image. 3: Output an RGB image. 
 


 Args
  image   A Tensor of type uint8. 3-D with shape [height, width, channels].  
  format   An optional string from: "", "grayscale", "rgb". Defaults to "". Per pixel image format.  
  quality   An optional int. Defaults to 95. Quality of the compression from 0 to 100 (higher is better and slower).  
  progressive   An optional bool. Defaults to False. If True, create a JPEG that loads progressively (coarse to fine).  
  optimize_size   An optional bool. Defaults to False. If True, spend CPU/RAM to reduce size with no quality change.  
  chroma_downsampling   An optional bool. Defaults to True. See http://en.wikipedia.org/wiki/Chroma_subsampling  
  density_unit   An optional string from: "in", "cm". Defaults to "in". Unit used to specify x_density and y_density: pixels per inch ('in') or centimeter ('cm').  
  x_density   An optional int. Defaults to 300. Horizontal pixels per density unit.  
  y_density   An optional int. Defaults to 300. Vertical pixels per density unit.  
  xmp_metadata   An optional string. Defaults to "". If not empty, embed this XMP metadata in the image header.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type string.
tf.io.encode_png PNG-encode an image.  View aliases  Main aliases 
tf.image.encode_png Compat aliases for migration See Migration guide for more details. tf.compat.v1.image.encode_png, tf.compat.v1.io.encode_png  
tf.io.encode_png(
    image, compression=-1, name=None
)
 image is a 3-D uint8 or uint16 Tensor of shape [height, width, channels] where channels is:  1: for grayscale. 2: for grayscale + alpha. 3: for RGB. 4: for RGBA.  The ZLIB compression level, compression, can be -1 for the PNG-encoder default or a value from 0 to 9. 9 is the highest compression level, generating the smallest output, but is slower.
 


 Args
  image   A Tensor. Must be one of the following types: uint8, uint16. 3-D with shape [height, width, channels].  
  compression   An optional int. Defaults to -1. Compression level.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type string.
tf.io.encode_proto The op serializes protobuf messages provided in the input tensors.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.encode_proto  
tf.io.encode_proto(
    sizes, values, field_names, message_type,
    descriptor_source='local://', name=None
)
 The types of the tensors in values must match the schema for the fields specified in field_names. All the tensors in values must have a common shape prefix, batch_shape. The sizes tensor specifies repeat counts for each field. The repeat count (last dimension) of a each tensor in values must be greater than or equal to corresponding repeat count in sizes. A message_type name must be provided to give context for the field names. The actual message descriptor can be looked up either in the linked-in descriptor pool or a filename provided by the caller using the descriptor_source attribute. For the most part, the mapping between Proto field types and TensorFlow dtypes is straightforward. However, there are a few special cases:  A proto field that contains a submessage or group can only be converted to DT_STRING (the serialized submessage). This is to reduce the complexity of the API. The resulting string can be used as input to another instance of the decode_proto op. TensorFlow lacks support for unsigned integers. The ops represent uint64 types as a DT_INT64 with the same twos-complement bit pattern (the obvious way). Unsigned int32 values can be represented exactly by specifying type DT_INT64, or using twos-complement if the caller specifies DT_INT32 in the output_types attribute.  The descriptor_source attribute selects the source of protocol descriptors to consult when looking up message_type. This may be:  An empty string or "local://", in which case protocol descriptors are created for C++ (not Python) proto definitions linked to the binary. A file, in which case protocol descriptors are created from the file, which is expected to contain a FileDescriptorSet serialized as a string. NOTE: You can build a descriptor_source file using the --descriptor_set_out and --include_imports options to the protocol compiler protoc. A "bytes://", in which protocol descriptors are created from <bytes>, which is expected to be a FileDescriptorSet serialized as a string. 
 


 Args
  sizes   A Tensor of type int32. Tensor of int32 with shape [batch_shape, len(field_names)].  
  values   A list of Tensor objects. List of tensors containing values for the corresponding field.  
  field_names   A list of strings. List of strings containing proto field names.  
  message_type   A string. Name of the proto message type to decode.  
  descriptor_source   An optional string. Defaults to "local://".  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type string.
tf.io.extract_jpeg_shape Extract the shape information of a JPEG-encoded image.  View aliases  Main aliases 
tf.image.extract_jpeg_shape Compat aliases for migration See Migration guide for more details. tf.compat.v1.image.extract_jpeg_shape, tf.compat.v1.io.extract_jpeg_shape  
tf.io.extract_jpeg_shape(
    contents, output_type=tf.dtypes.int32, name=None
)
 This op only parses the image header, so it is much faster than DecodeJpeg.
 


 Args
  contents   A Tensor of type string. 0-D. The JPEG-encoded image.  
  output_type   An optional tf.DType from: tf.int32, tf.int64. Defaults to tf.int32. (Optional) The output type of the operation (int32 or int64). Defaults to int32.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type output_type.
tf.io.FixedLenFeature     View source on GitHub    Configuration for parsing a fixed-length input feature.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.FixedLenFeature, tf.compat.v1.io.FixedLenFeature  
tf.io.FixedLenFeature(
    shape, dtype, default_value=None
)
 To treat sparse input as dense, provide a default_value; otherwise, the parse functions will fail on any examples missing this feature. Fields:  
shape: Shape of input data. 
dtype: Data type of input. 
default_value: Value to be used if an example is missing this feature. It must be compatible with dtype and of the specified shape. 
 


 Attributes
  shape  
 
  dtype  
 
  default_value
tf.io.FixedLenSequenceFeature     View source on GitHub    Configuration for parsing a variable-length input feature into a Tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.FixedLenSequenceFeature, tf.compat.v1.io.FixedLenSequenceFeature  
tf.io.FixedLenSequenceFeature(
    shape, dtype, allow_missing=False, default_value=None
)
 The resulting Tensor of parsing a single SequenceExample or Example has a static shape of [None] + shape and the specified dtype. The resulting Tensor of parsing a batch_size many Examples has a static shape of [batch_size, None] + shape and the specified dtype. The entries in the batch from different Examples will be padded with default_value to the maximum length present in the batch. To treat a sparse input as dense, provide allow_missing=True; otherwise, the parse functions will fail on any examples missing this feature. Fields:  
shape: Shape of input data for dimension 2 and higher. First dimension is of variable length None. 
dtype: Data type of input. 
allow_missing: Whether to allow this feature to be missing from a feature list item. Is available only for parsing SequenceExample not for parsing Examples. 
default_value: Scalar value to be used to pad multiple Examples to their maximum length. Irrelevant for parsing a single Example or SequenceExample. Defaults to "" for dtype string and 0 otherwise (optional). 
 


 Attributes
  shape  
 
  dtype  
 
  allow_missing  
 
  default_value
Module: tf.io.gfile Public API for tf.io.gfile namespace. Classes class GFile: File I/O wrappers without thread locking. Functions copy(...): Copies data from src to dst. exists(...): Determines whether a path exists or not. glob(...): Returns a list of files that match the given pattern(s). isdir(...): Returns whether the path is a directory or not. listdir(...): 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 given by path. remove(...): Deletes the path located at 'path'. rename(...): Rename or move a file / directory. rmtree(...): Deletes everything under path recursively. stat(...): Returns file statistics for a given path. walk(...): Recursive directory tree generator for directories.
tf.io.gfile.copy     View source on GitHub    Copies data from src to dst.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.copy  
tf.io.gfile.copy(
    src, dst, overwrite=False
)

 


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


 Raises
  errors.OpError   If the operation fails.
tf.io.gfile.exists     View source on GitHub    Determines whether a path exists or not.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.exists  
tf.io.gfile.exists(
    path
)

 


 Args
  path   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.io.gfile.glob     View source on GitHub    Returns a list of files that match the given pattern(s).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.glob  
tf.io.gfile.glob(
    pattern
)
 The patterns are defined as strings. Supported patterns are defined here. Note that the pattern can be a Python iteratable of string patterns. The format definition of the pattern is: pattern: { term } term:  
'*': matches any sequence of non-'/' characters 
'?': matches a single non-'/' character 
'[' [ '^' ] { match-list } ']': matches any single character (not) on the list 
c: matches character c where c != '*', '?', '\\', '['
 
'\\' c: matches character c
  character range:  
c: matches character c while c != '\\', '-', ']'
 
'\\' c: matches character c
 
lo '-' hi: matches character c for lo <= c <= hi
  Examples: 
tf.io.gfile.glob("*.py")
# For example, ['__init__.py']
 
tf.io.gfile.glob("__init__.??")
# As above
 
files = {"*.py"}
the_iterator = iter(files)
tf.io.gfile.glob(the_iterator)
# As above
 See the C++ function GetMatchingPaths in core/platform/file_system.h for implementation details.
 


 Args
  pattern   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.io.gfile.isdir     View source on GitHub    Returns whether the path is a directory or not.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.isdir  
tf.io.gfile.isdir(
    path
)

 


 Args
  path   string, path to a potential directory   
 


 Returns   True, if the path is a directory; False otherwise
tf.io.gfile.listdir     View source on GitHub    Returns a list of entries contained within a directory.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.listdir  
tf.io.gfile.listdir(
    path
)
 The list is in arbitrary order. It does not contain the special entries "." and "..".
 


 Args
  path   string, path to a directory   
 


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

 


 Raises   errors.NotFoundError if directory doesn't exist
tf.io.gfile.makedirs     View source on GitHub    Creates a directory and all parent/intermediate directories.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.makedirs  
tf.io.gfile.makedirs(
    path
)
 It succeeds if path already exists and is writable.
 


 Args
  path   string, name of the directory to be created   
 


 Raises
  errors.OpError   If the operation fails.
tf.io.gfile.mkdir     View source on GitHub    Creates a directory with the name given by path.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.mkdir  
tf.io.gfile.mkdir(
    path
)

 


 Args
  path   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.io.gfile.remove     View source on GitHub    Deletes the path located at 'path'.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.remove  
tf.io.gfile.remove(
    path
)

 


 Args
  path   string, a path   
 


 Raises
  errors.OpError   Propagates any errors reported by the FileSystem API. E.g., NotFoundError if the path does not exist.
tf.io.gfile.rename     View source on GitHub    Rename or move a file / directory.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.rename  
tf.io.gfile.rename(
    src, dst, overwrite=False
)

 


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


 Raises
  errors.OpError   If the operation fails.
tf.io.gfile.rmtree     View source on GitHub    Deletes everything under path recursively.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.rmtree  
tf.io.gfile.rmtree(
    path
)

 


 Args
  path   string, a path   
 


 Raises
  errors.OpError   If the operation fails.
tf.io.gfile.stat     View source on GitHub    Returns file statistics for a given path.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.stat  
tf.io.gfile.stat(
    path
)

 


 Args
  path   string, path to a file   
 


 Returns   FileStatistics struct that contains information about the path  

 


 Raises
  errors.OpError   If the operation fails.
tf.io.gfile.walk     View source on GitHub    Recursive directory tree generator for directories.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.gfile.walk  
tf.io.gfile.walk(
    top, topdown=True, onerror=None
)

 


 Args
  top   string, a Directory name  
  topdown   bool, Traverse pre order if True, post order if False.  
  onerror   optional handler for errors. Should be a function, it will be called with the error as argument. Rethrowing the error aborts the walk. 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.io.is_jpeg     View source on GitHub    Convenience function to check if the 'contents' encodes a JPEG image.  View aliases  Main aliases 
tf.image.is_jpeg Compat aliases for migration See Migration guide for more details. tf.compat.v1.image.is_jpeg, tf.compat.v1.io.is_jpeg  
tf.io.is_jpeg(
    contents, name=None
)

 


 Args
  contents   0-D string. The encoded image bytes.  
  name   A name for the operation (optional)   
 


 Returns   A scalar boolean tensor indicating if 'contents' may be a JPEG image. is_jpeg is susceptible to false positives.
tf.io.matching_files Returns the set of files matching one or more glob patterns.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.matching_files, tf.compat.v1.matching_files  
tf.io.matching_files(
    pattern, name=None
)
 Note that this routine only supports wildcard characters in the basename portion of the pattern, not in the directory portion. Note also that the order of filenames returned is deterministic.
 


 Args
  pattern   A Tensor of type string. Shell wildcard pattern(s). Scalar or vector of type string.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type string.
tf.io.match_filenames_once     View source on GitHub    Save the list of files matching pattern, so it is only computed once.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.match_filenames_once, tf.compat.v1.train.match_filenames_once  
tf.io.match_filenames_once(
    pattern, name=None
)
 
Note: The order of the files returned is deterministic.

 


 Args
  pattern   A file pattern (glob), or 1D tensor of file patterns.  
  name   A name for the operations (optional).   
 


 Returns   A variable that is initialized to the list of files matching the pattern(s).
tf.io.parse_single_example     View source on GitHub    Parses a single Example proto. 
tf.io.parse_single_example(
    serialized, features, example_names=None, name=None
)
 Similar to parse_example, except: For dense tensors, the returned Tensor is identical to the output of parse_example, except there is no batch dimension, the output shape is the same as the shape given in dense_shape. For SparseTensors, the first (batch) column of the indices matrix is removed (the indices matrix is a column vector), the values vector is unchanged, and the first (batch_size) entry of the shape vector is removed (it is now a single element vector). One might see performance advantages by batching Example protos with parse_example instead of using this function directly.
 


 Args
  serialized   A scalar string Tensor, a single serialized Example.  
  features   A dict mapping feature keys to FixedLenFeature or VarLenFeature values.  
  example_names   (Optional) A scalar string Tensor, the associated name.  
  name   A name for this operation (optional).   
 


 Returns   A dict mapping feature keys to Tensor and SparseTensor values.  

 


 Raises
  ValueError   if any feature is invalid.
tf.io.parse_tensor Transforms a serialized tensorflow.TensorProto proto into a Tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.parse_tensor, tf.compat.v1.parse_tensor  
tf.io.parse_tensor(
    serialized, out_type, name=None
)

 


 Args
  serialized   A Tensor of type string. A scalar string containing a serialized TensorProto proto.  
  out_type   A tf.DType. The type of the serialized tensor. The provided type must match the type of the serialized tensor and no implicit conversion will take place.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type out_type.
tf.io.RaggedFeature.RowLengths RowLengths(key,)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.RaggedFeature.RowLengths  
tf.io.RaggedFeature.RowLengths(
    key
)

 


 Attributes
  key
tf.io.RaggedFeature.RowLimits RowLimits(key,)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.RaggedFeature.RowLimits  
tf.io.RaggedFeature.RowLimits(
    key
)

 


 Attributes
  key
tf.io.RaggedFeature.RowSplits RowSplits(key,)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.RaggedFeature.RowSplits  
tf.io.RaggedFeature.RowSplits(
    key
)

 


 Attributes
  key
tf.io.RaggedFeature.RowStarts RowStarts(key,)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.RaggedFeature.RowStarts  
tf.io.RaggedFeature.RowStarts(
    key
)

 


 Attributes
  key
tf.io.RaggedFeature.UniformRowLength UniformRowLength(length,)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.RaggedFeature.UniformRowLength  
tf.io.RaggedFeature.UniformRowLength(
    length
)

 


 Attributes
  length
tf.io.RaggedFeature.ValueRowIds ValueRowIds(key,)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.RaggedFeature.ValueRowIds  
tf.io.RaggedFeature.ValueRowIds(
    key
)

 


 Attributes
  key
tf.io.read_file Reads and outputs the entire contents of the input filename.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.read_file, tf.compat.v1.read_file  
tf.io.read_file(
    filename, name=None
)

 


 Args
  filename   A Tensor of type string.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type string.
tf.io.serialize_many_sparse     View source on GitHub    Serialize N-minibatch SparseTensor into an [N, 3] Tensor. 
tf.io.serialize_many_sparse(
    sp_input, out_type=tf.dtypes.string, name=None
)
 The SparseTensor must have rank R greater than 1, and the first dimension is treated as the minibatch dimension. Elements of the SparseTensor must be sorted in increasing order of this first dimension. The serialized SparseTensor objects going into each row of the output Tensor will have rank R-1. The minibatch size N is extracted from sparse_shape[0].
 


 Args
  sp_input   The input rank R SparseTensor.  
  out_type   The dtype to use for serialization.  
  name   A name prefix for the returned tensors (optional).   
 


 Returns   A matrix (2-D Tensor) with N rows and 3 columns. Each column represents serialized SparseTensor's indices, values, and shape (respectively).  

 


 Raises
  TypeError   If sp_input is not a SparseTensor.
tf.io.serialize_sparse     View source on GitHub    Serialize a SparseTensor into a 3-vector (1-D Tensor) object. 
tf.io.serialize_sparse(
    sp_input, out_type=tf.dtypes.string, name=None
)

 


 Args
  sp_input   The input SparseTensor.  
  out_type   The dtype to use for serialization.  
  name   A name prefix for the returned tensors (optional).   
 


 Returns   A 3-vector (1-D Tensor), with each column representing the serialized SparseTensor's indices, values, and shape (respectively).  

 


 Raises
  TypeError   If sp_input is not a SparseTensor.
tf.io.serialize_tensor Transforms a Tensor into a serialized TensorProto proto.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.io.serialize_tensor, tf.compat.v1.serialize_tensor  
tf.io.serialize_tensor(
    tensor, name=None
)

 


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


 Returns   A Tensor of type string.