doc_content
stringlengths 1
386k
| doc_id
stringlengths 5
188
|
---|---|
tf.raw_ops.OutfeedDequeue Retrieves a single tensor from the computation outfeed. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OutfeedDequeue
tf.raw_ops.OutfeedDequeue(
dtype, shape, device_ordinal=-1, name=None
)
This operation will block indefinitely until data is available.
Args
dtype A tf.DType. The type of elements in the tensor.
shape A tf.TensorShape or list of ints. The shape of the tensor.
device_ordinal An optional int. Defaults to -1. The TPU device to use. This should be -1 when the Op is running on a TPU device, and >= 0 when the Op is running on the CPU device.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.outfeeddequeue |
tf.raw_ops.OutfeedDequeueTuple Retrieve multiple values from the computation outfeed. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OutfeedDequeueTuple
tf.raw_ops.OutfeedDequeueTuple(
dtypes, shapes, device_ordinal=-1, name=None
)
This operation will block indefinitely until data is available. Output i corresponds to XLA tuple element i.
Args
dtypes A list of tf.DTypes that has length >= 1. The element types of each element in outputs.
shapes A list of shapes (each a tf.TensorShape or list of ints). The shapes of each tensor in outputs.
device_ordinal An optional int. Defaults to -1. The TPU device to use. This should be -1 when the Op is running on a TPU device, and >= 0 when the Op is running on the CPU device.
name A name for the operation (optional).
Returns A list of Tensor objects of type dtypes. | tensorflow.raw_ops.outfeeddequeuetuple |
tf.raw_ops.OutfeedDequeueTupleV2 Retrieve multiple values from the computation outfeed. Device ordinal is a View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OutfeedDequeueTupleV2
tf.raw_ops.OutfeedDequeueTupleV2(
device_ordinal, dtypes, shapes, name=None
)
tensor allowing dynamic outfeed. This operation will block indefinitely until data is available. Output i corresponds to XLA tuple element i. Args: device_ordinal: A Tensor of type int32. An int scalar tensor, representing the TPU device to use. This should be -1 when the Op is running on a TPU device, and >= 0 when the Op is running on the CPU device. dtypes: A list of tf.DTypes that has length >= 1. The element types of each element in outputs. shapes: A list of shapes (each a tf.TensorShape or list of ints). The shapes of each tensor in outputs. name: A name for the operation (optional). Returns: A list of Tensor objects of type dtypes. | tensorflow.raw_ops.outfeeddequeuetuplev2 |
tf.raw_ops.OutfeedDequeueV2 Retrieves a single tensor from the computation outfeed. Device ordinal is a View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OutfeedDequeueV2
tf.raw_ops.OutfeedDequeueV2(
device_ordinal, dtype, shape, name=None
)
tensor allowing dynamic outfeed. This operation will block indefinitely until data is available. Args: device_ordinal: A Tensor of type int32. An int scalar tensor, representing the TPU device to use. This should be -1 when the Op is running on a TPU device, and >= 0 when the Op is running on the CPU device. dtype: A tf.DType. The type of elements in the tensor. shape: A tf.TensorShape or list of ints. The shape of the tensor. name: A name for the operation (optional). Returns: A Tensor of type dtype. | tensorflow.raw_ops.outfeeddequeuev2 |
tf.raw_ops.OutfeedEnqueue Enqueue a Tensor on the computation outfeed. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OutfeedEnqueue
tf.raw_ops.OutfeedEnqueue(
input, name=None
)
Args
input A Tensor. A tensor that will be inserted into the outfeed queue.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.outfeedenqueue |
tf.raw_ops.OutfeedEnqueueTuple Enqueue multiple Tensor values on the computation outfeed. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OutfeedEnqueueTuple
tf.raw_ops.OutfeedEnqueueTuple(
inputs, name=None
)
Args
inputs A list of Tensor objects. A list of tensors that will be inserted into the outfeed queue as an XLA tuple.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.outfeedenqueuetuple |
tf.raw_ops.Pack Packs a list of N rank-R tensors into one rank-(R+1) tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Pack
tf.raw_ops.Pack(
values, axis=0, name=None
)
Packs the N tensors in values into a tensor with rank one higher than each tensor in values, by packing them along the axis dimension. Given a list of tensors of shape (A, B, C); if axis == 0 then the output tensor will have the shape (N, A, B, C). if axis == 1 then the output tensor will have the shape (A, N, B, C). Etc. For example: # 'x' is [1, 4]
# 'y' is [2, 5]
# 'z' is [3, 6]
pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim.
pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]
This is the opposite of unpack.
Args
values A list of at least 1 Tensor objects with the same type. Must be of same shape and type.
axis An optional int. Defaults to 0. Dimension along which to pack. Negative values wrap around, so the valid range is [-(R+1), R+1).
name A name for the operation (optional).
Returns A Tensor. Has the same type as values. | tensorflow.raw_ops.pack |
tf.raw_ops.Pad Pads a tensor with zeros. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Pad
tf.raw_ops.Pad(
input, paddings, name=None
)
This operation pads a input with zeros according to the paddings you specify. paddings is an integer tensor with shape [Dn, 2], where n is the rank of input. For each dimension D of input, paddings[D, 0] indicates how many zeros to add before the contents of input in that dimension, and paddings[D, 1] indicates how many zeros to add after the contents of input in that dimension. The padded size of each dimension D of the output is: paddings(D, 0) + input.dim_size(D) + paddings(D, 1) For example: # 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1], [2, 2]]
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
[0, 0, 1, 1, 0, 0]
[0, 0, 2, 2, 0, 0]
[0, 0, 0, 0, 0, 0]]
Args
input A Tensor.
paddings A Tensor. Must be one of the following types: int32, int64.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.pad |
tf.raw_ops.PaddedBatchDataset Creates a dataset that batches and pads batch_size elements from the input. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PaddedBatchDataset
tf.raw_ops.PaddedBatchDataset(
input_dataset, batch_size, padded_shapes, padding_values, output_shapes,
name=None
)
Args
input_dataset A Tensor of type variant.
batch_size A Tensor of type int64. A scalar representing the number of elements to accumulate in a batch.
padded_shapes A list of at least 1 Tensor objects with type int64. A list of int64 tensors representing the desired padded shapes of the corresponding output components. These shapes may be partially specified, using -1 to indicate that a particular dimension should be padded to the maximum size of all batch elements.
padding_values A list of Tensor objects. A list of scalars containing the padding value to use for each of the outputs.
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. | tensorflow.raw_ops.paddedbatchdataset |
tf.raw_ops.PaddedBatchDatasetV2 Creates a dataset that batches and pads batch_size elements from the input. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PaddedBatchDatasetV2
tf.raw_ops.PaddedBatchDatasetV2(
input_dataset, batch_size, padded_shapes, padding_values, drop_remainder,
output_shapes, parallel_copy=False, name=None
)
Args
input_dataset A Tensor of type variant.
batch_size A Tensor of type int64. A scalar representing the number of elements to accumulate in a batch.
padded_shapes A list of at least 1 Tensor objects with type int64. A list of int64 tensors representing the desired padded shapes of the corresponding output components. These shapes may be partially specified, using -1 to indicate that a particular dimension should be padded to the maximum size of all batch elements.
padding_values A list of Tensor objects. A list of scalars containing the padding value to use for each of the outputs.
drop_remainder A Tensor of type bool. A scalar representing whether the last batch should be dropped in case its size is smaller than desired.
output_shapes A list of shapes (each a tf.TensorShape or list of ints) that has length >= 1.
parallel_copy An optional bool. Defaults to False.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.paddedbatchdatasetv2 |
tf.raw_ops.PaddingFIFOQueue A queue that produces elements in first-in first-out order. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PaddingFIFOQueue
tf.raw_ops.PaddingFIFOQueue(
component_types, shapes=[], capacity=-1, container='',
shared_name='', name=None
)
Variable-size shapes are allowed by setting the corresponding shape dimensions to 0 in the shape attr. In this case DequeueMany will pad up to the maximum size of any given element in the minibatch. See below for details.
Args
component_types A list of tf.DTypes that has length >= 1. The type of each component in a value.
shapes An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to []. The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component_types. Shapes of fixed rank but variable size are allowed by setting any shape dimension to -1. In this case, the inputs' shape may vary along the given dimension, and DequeueMany will pad the given dimension with zeros up to the maximum shape of all elements in the given batch. If the length of this attr is 0, different queue elements may have different ranks and shapes, but only one element may be dequeued at a time.
capacity An optional int. Defaults to -1. The upper bound on the number of elements in this queue. Negative numbers mean no limit.
container An optional string. Defaults to "". If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this queue will be shared under the given name across multiple sessions.
name A name for the operation (optional).
Returns A Tensor of type mutable string. | tensorflow.raw_ops.paddingfifoqueue |
tf.raw_ops.PaddingFIFOQueueV2 A queue that produces elements in first-in first-out order. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PaddingFIFOQueueV2
tf.raw_ops.PaddingFIFOQueueV2(
component_types, shapes=[], capacity=-1, container='',
shared_name='', name=None
)
Variable-size shapes are allowed by setting the corresponding shape dimensions to 0 in the shape attr. In this case DequeueMany will pad up to the maximum size of any given element in the minibatch. See below for details.
Args
component_types A list of tf.DTypes that has length >= 1. The type of each component in a value.
shapes An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to []. The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component_types. Shapes of fixed rank but variable size are allowed by setting any shape dimension to -1. In this case, the inputs' shape may vary along the given dimension, and DequeueMany will pad the given dimension with zeros up to the maximum shape of all elements in the given batch. If the length of this attr is 0, different queue elements may have different ranks and shapes, but only one element may be dequeued at a time.
capacity An optional int. Defaults to -1. The upper bound on the number of elements in this queue. Negative numbers mean no limit.
container An optional string. Defaults to "". If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this queue will be shared under the given name across multiple sessions.
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.paddingfifoqueuev2 |
tf.raw_ops.PadV2 Pads a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PadV2
tf.raw_ops.PadV2(
input, paddings, constant_values, name=None
)
This operation pads input according to the paddings and constant_values you specify. paddings is an integer tensor with shape [Dn, 2], where n is the rank of input. For each dimension D of input, paddings[D, 0] indicates how many padding values to add before the contents of input in that dimension, and paddings[D, 1] indicates how many padding values to add after the contents of input in that dimension. constant_values is a scalar tensor of the same type as input that indicates the value to use for padding input. The padded size of each dimension D of the output is: paddings(D, 0) + input.dim_size(D) + paddings(D, 1) For example: # 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1], [2, 2]]
# 'constant_values' is 0
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
[0, 0, 1, 1, 0, 0]
[0, 0, 2, 2, 0, 0]
[0, 0, 0, 0, 0, 0]]
Args
input A Tensor.
paddings A Tensor. Must be one of the following types: int32, int64.
constant_values A Tensor. Must have the same type as input.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.padv2 |
tf.raw_ops.ParallelConcat Concatenates a list of N tensors along the first dimension. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParallelConcat
tf.raw_ops.ParallelConcat(
values, shape, name=None
)
The input tensors are all required to have size 1 in the first dimension. For example: # 'x' is [[1, 4]]
# 'y' is [[2, 5]]
# 'z' is [[3, 6]]
parallel_concat([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim.
The difference between concat and parallel_concat is that concat requires all of the inputs be computed before the operation will begin but doesn't require that the input shapes be known during graph construction. Parallel concat will copy pieces of the input into the output as they become available, in some situations this can provide a performance benefit.
Args
values A list of at least 1 Tensor objects with the same type. Tensors to be concatenated. All must have size 1 in the first dimension and same shape.
shape A tf.TensorShape or list of ints. the final shape of the result; should be equal to the shapes of any input but with the number of input values in the first dimension.
name A name for the operation (optional).
Returns A Tensor. Has the same type as values. | tensorflow.raw_ops.parallelconcat |
tf.raw_ops.ParallelDynamicStitch Interleave the values from the data tensors into a single tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParallelDynamicStitch
tf.raw_ops.ParallelDynamicStitch(
indices, data, name=None
)
Builds a merged tensor such that merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]
For example, if each indices[m] is scalar or vector, we have # Scalar indices:
merged[indices[m], ...] = data[m][...]
# Vector indices:
merged[indices[m][i], ...] = data[m][i, ...]
Each data[i].shape must start with the corresponding indices[i].shape, and the rest of data[i].shape must be constant w.r.t. i. That is, we must have data[i].shape = indices[i].shape + constant. In terms of this constant, the output shape is merged.shape = [max(indices)] + constant
Values may be merged in parallel, so if an index appears in both indices[m][i] and indices[n][j], the result may be invalid. This differs from the normal DynamicStitch operator that defines the behavior in that case. For example: indices[0] = 6
indices[1] = [4, 1]
indices[2] = [[5, 2], [0, 3]]
data[0] = [61, 62]
data[1] = [[41, 42], [11, 12]]
data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
[51, 52], [61, 62]]
This method can be used to merge partitions created by dynamic_partition as illustrated on the following example: # Apply function (increments x_i) on elements for which a certain condition
# apply (x_i != -1 in this example).
x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])
condition_mask=tf.not_equal(x,tf.constant(-1.))
partitioned_data = tf.dynamic_partition(
x, tf.cast(condition_mask, tf.int32) , 2)
partitioned_data[1] = partitioned_data[1] + 1.0
condition_indices = tf.dynamic_partition(
tf.range(tf.shape(x)[0]), tf.cast(condition_mask, tf.int32) , 2)
x = tf.dynamic_stitch(condition_indices, partitioned_data)
# Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain
# unchanged.
Args
indices A list of at least 1 Tensor objects with type int32.
data A list with the same length as indices of Tensor objects with the same type.
name A name for the operation (optional).
Returns A Tensor. Has the same type as data. | tensorflow.raw_ops.paralleldynamicstitch |
tf.raw_ops.ParallelInterleaveDataset Creates a dataset that applies f to the outputs of input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParallelInterleaveDataset
tf.raw_ops.ParallelInterleaveDataset(
input_dataset, other_arguments, cycle_length, block_length, sloppy,
buffer_output_elements, prefetch_input_elements, f, output_types, output_shapes,
name=None
)
The resulting dataset is similar to the InterleaveDataset, with the exception that if retrieving the next value from a dataset would cause the requester to block, it will skip that input dataset. This dataset is especially useful when loading data from a variable-latency datastores (e.g. HDFS, GCS), as it allows the training step to proceed so long as some data is available. !! WARNING !! If the sloppy parameter is set to True, the operation of this dataset will not be deterministic! This dataset has been superseded by ParallelInterleaveDatasetV2. New code should use ParallelInterleaveDatasetV2. The Python API tf.data.experimental.parallel_interleave creates instances of this op. tf.data.experimental.parallel_interleave is a deprecated API.
Args
input_dataset A Tensor of type variant. Dataset that produces a stream of arguments for the function f.
other_arguments A list of Tensor objects. Additional arguments to pass to f beyond those produced by input_dataset. Evaluated once when the dataset is instantiated.
cycle_length A Tensor of type int64. Number of datasets (each created by applying f to the elements of input_dataset) among which the ParallelInterleaveDataset will cycle in a round-robin fashion.
block_length A Tensor of type int64. Number of elements at a time to produce from each interleaved invocation of a dataset returned by f.
sloppy A Tensor of type bool. If True, return elements as they become available, even if that means returning these elements in a non-deterministic order. Sloppy operation may result in better performance in the presence of stragglers, but the dataset will still block if all of its open streams are blocked. If False, always return elements in a deterministic order.
buffer_output_elements A Tensor of type int64. The number of elements each iterator being interleaved should buffer (similar to the .prefetch() transformation for each interleaved iterator).
prefetch_input_elements A Tensor of type int64. Determines the number of iterators to prefetch, allowing buffers to warm up and data to be pre-fetched without blocking the main thread.
f A function decorated with @Defun. A function mapping elements of input_dataset, concatenated with other_arguments, to a Dataset variant that contains elements matching output_types and output_shapes.
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. | tensorflow.raw_ops.parallelinterleavedataset |
tf.raw_ops.ParallelInterleaveDatasetV2 Creates a dataset that applies f to the outputs of input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParallelInterleaveDatasetV2
tf.raw_ops.ParallelInterleaveDatasetV2(
input_dataset, other_arguments, cycle_length, block_length, num_parallel_calls,
f, output_types, output_shapes, sloppy=False, name=None
)
The resulting dataset is similar to the InterleaveDataset, except that the dataset will fetch records from the interleaved datasets in parallel. The tf.data Python API creates instances of this op from Dataset.interleave() when the num_parallel_calls parameter of that method is set to any value other than None. By default, the output of this dataset will be deterministic, which may result in the dataset blocking if the next data item to be returned isn't available. In order to avoid head-of-line blocking, one can set the experimental_deterministic parameter of tf.data.Options to False, which can improve performance at the expense of non-determinism.
Args
input_dataset A Tensor of type variant. Dataset that produces a stream of arguments for the function f.
other_arguments A list of Tensor objects. Additional arguments to pass to f beyond those produced by input_dataset. Evaluated once when the dataset is instantiated.
cycle_length A Tensor of type int64. Number of datasets (each created by applying f to the elements of input_dataset) among which the ParallelInterleaveDatasetV2 will cycle in a round-robin fashion.
block_length A Tensor of type int64. Number of elements at a time to produce from each interleaved invocation of a dataset returned by f.
num_parallel_calls A Tensor of type int64. Determines the number of threads that should be used for fetching data from input datasets in parallel. The Python API tf.data.experimental.AUTOTUNE constant can be used to indicate that the level of parallelism should be autotuned.
f A function decorated with @Defun. A function mapping elements of input_dataset, concatenated with other_arguments, to a Dataset variant that contains elements matching output_types and output_shapes.
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.
sloppy An optional bool. Defaults to False.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.parallelinterleavedatasetv2 |
tf.raw_ops.ParallelInterleaveDatasetV3 Creates a dataset that applies f to the outputs of input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParallelInterleaveDatasetV3
tf.raw_ops.ParallelInterleaveDatasetV3(
input_dataset, other_arguments, cycle_length, block_length, num_parallel_calls,
f, output_types, output_shapes, deterministic='default', name=None
)
The resulting dataset is similar to the InterleaveDataset, except that the dataset will fetch records from the interleaved datasets in parallel. The tf.data Python API creates instances of this op from Dataset.interleave() when the num_parallel_calls parameter of that method is set to any value other than None. By default, the output of this dataset will be deterministic, which may result in the dataset blocking if the next data item to be returned isn't available. In order to avoid head-of-line blocking, one can either set the deterministic attribute to "false", or leave it as "default" and set the experimental_deterministic parameter of tf.data.Options to False. This can improve performance at the expense of non-determinism.
Args
input_dataset A Tensor of type variant. Dataset that produces a stream of arguments for the function f.
other_arguments A list of Tensor objects. Additional arguments to pass to f beyond those produced by input_dataset. Evaluated once when the dataset is instantiated.
cycle_length A Tensor of type int64. Number of datasets (each created by applying f to the elements of input_dataset) among which the ParallelInterleaveDatasetV2 will cycle in a round-robin fashion.
block_length A Tensor of type int64. Number of elements at a time to produce from each interleaved invocation of a dataset returned by f.
num_parallel_calls A Tensor of type int64. Determines the number of threads that should be used for fetching data from input datasets in parallel. The Python API tf.data.experimental.AUTOTUNE constant can be used to indicate that the level of parallelism should be autotuned.
f A function decorated with @Defun. A function mapping elements of input_dataset, concatenated with other_arguments, to a Dataset variant that contains elements matching output_types and output_shapes.
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.
deterministic An optional string. Defaults to "default". A string indicating the op-level determinism to use. Deterministic controls whether the interleave is allowed to return elements out of order if the next element to be returned isn't available, but a later element is. Options are "true", "false", and "default". "default" indicates that determinism should be decided by the experimental_deterministic parameter of tf.data.Options.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.parallelinterleavedatasetv3 |
tf.raw_ops.ParallelInterleaveDatasetV4 Creates a dataset that applies f to the outputs of input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParallelInterleaveDatasetV4
tf.raw_ops.ParallelInterleaveDatasetV4(
input_dataset, other_arguments, cycle_length, block_length,
buffer_output_elements, prefetch_input_elements, num_parallel_calls, f,
output_types, output_shapes, deterministic='default', name=None
)
The resulting dataset is similar to the InterleaveDataset, except that the dataset will fetch records from the interleaved datasets in parallel. The tf.data Python API creates instances of this op from Dataset.interleave() when the num_parallel_calls parameter of that method is set to any value other than None. By default, the output of this dataset will be deterministic, which may result in the dataset blocking if the next data item to be returned isn't available. In order to avoid head-of-line blocking, one can either set the deterministic attribute to "false", or leave it as "default" and set the experimental_deterministic parameter of tf.data.Options to False. This can improve performance at the expense of non-determinism.
Args
input_dataset A Tensor of type variant. Dataset that produces a stream of arguments for the function f.
other_arguments A list of Tensor objects. Additional arguments to pass to f beyond those produced by input_dataset. Evaluated once when the dataset is instantiated.
cycle_length A Tensor of type int64. Number of datasets (each created by applying f to the elements of input_dataset) among which the ParallelInterleaveDatasetV2 will cycle in a round-robin fashion.
block_length A Tensor of type int64. Number of elements at a time to produce from each interleaved invocation of a dataset returned by f.
buffer_output_elements A Tensor of type int64. The number of elements each iterator being interleaved should buffer (similar to the .prefetch() transformation for each interleaved iterator).
prefetch_input_elements A Tensor of type int64. Determines the number of iterators to prefetch, allowing buffers to warm up and data to be pre-fetched without blocking the main thread.
num_parallel_calls A Tensor of type int64. Determines the number of threads that should be used for fetching data from input datasets in parallel. The Python API tf.data.experimental.AUTOTUNE constant can be used to indicate that the level of parallelism should be autotuned.
f A function decorated with @Defun. A function mapping elements of input_dataset, concatenated with other_arguments, to a Dataset variant that contains elements matching output_types and output_shapes.
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.
deterministic An optional string. Defaults to "default". A string indicating the op-level determinism to use. Deterministic controls whether the interleave is allowed to return elements out of order if the next element to be returned isn't available, but a later element is. Options are "true", "false", and "default". "default" indicates that determinism should be decided by the experimental_deterministic parameter of tf.data.Options.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.parallelinterleavedatasetv4 |
tf.raw_ops.ParallelMapDataset Creates a dataset that applies f to the outputs of input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParallelMapDataset
tf.raw_ops.ParallelMapDataset(
input_dataset, other_arguments, num_parallel_calls, f, output_types,
output_shapes, use_inter_op_parallelism=True, sloppy=False,
preserve_cardinality=False, name=None
)
Unlike a "MapDataset", which applies f sequentially, this dataset invokes up to num_parallel_calls copies of f in parallel.
Args
input_dataset A Tensor of type variant.
other_arguments A list of Tensor objects.
num_parallel_calls A Tensor of type int32. The number of concurrent invocations of f that process elements from input_dataset in parallel.
f A function decorated with @Defun.
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.
use_inter_op_parallelism An optional bool. Defaults to True.
sloppy An optional bool. Defaults to False.
preserve_cardinality An optional bool. Defaults to False.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.parallelmapdataset |
tf.raw_ops.ParallelMapDatasetV2 Creates a dataset that applies f to the outputs of input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParallelMapDatasetV2
tf.raw_ops.ParallelMapDatasetV2(
input_dataset, other_arguments, num_parallel_calls, f, output_types,
output_shapes, use_inter_op_parallelism=True, deterministic='default',
preserve_cardinality=False, name=None
)
Unlike a "MapDataset", which applies f sequentially, this dataset invokes up to num_parallel_calls copies of f in parallel.
Args
input_dataset A Tensor of type variant.
other_arguments A list of Tensor objects.
num_parallel_calls A Tensor of type int64. The number of concurrent invocations of f that process elements from input_dataset in parallel.
f A function decorated with @Defun.
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.
use_inter_op_parallelism An optional bool. Defaults to True.
deterministic An optional string. Defaults to "default".
preserve_cardinality An optional bool. Defaults to False.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.parallelmapdatasetv2 |
tf.raw_ops.ParameterizedTruncatedNormal Outputs random values from a normal distribution. The parameters may each be a View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParameterizedTruncatedNormal
tf.raw_ops.ParameterizedTruncatedNormal(
shape, means, stdevs, minvals, maxvals, seed=0, seed2=0, name=None
)
scalar which applies to the entire output, or a vector of length shape[0] which stores the parameters for each batch.
Args
shape A Tensor. Must be one of the following types: int32, int64. The shape of the output tensor. Batches are indexed by the 0th dimension.
means A Tensor. Must be one of the following types: half, bfloat16, float32, float64. The mean parameter of each batch.
stdevs A Tensor. Must have the same type as means. The standard deviation parameter of each batch. Must be greater than 0.
minvals A Tensor. Must have the same type as means. The minimum cutoff. May be -infinity.
maxvals A Tensor. Must have the same type as means. The maximum cutoff. May be +infinity, and must be more than the minval for each batch.
seed An optional int. Defaults to 0. If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
seed2 An optional int. Defaults to 0. A second seed to avoid seed collision.
name A name for the operation (optional).
Returns A Tensor. Has the same type as means. | tensorflow.raw_ops.parameterizedtruncatednormal |
tf.raw_ops.ParseExample Transforms a vector of brain.Example protos (as strings) into typed tensors. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParseExample
tf.raw_ops.ParseExample(
serialized, names, sparse_keys, dense_keys, dense_defaults, sparse_types,
dense_shapes, name=None
)
Args
serialized A Tensor of type string. A vector containing a batch of binary serialized Example protos.
names A Tensor of type string. A vector containing the names of the serialized protos. May contain, for example, table key (descriptive) names for the corresponding serialized protos. These are purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty vector if no names are available. If non-empty, this vector must be the same length as "serialized".
sparse_keys A list of Tensor objects with type string. A list of Nsparse string Tensors (scalars). The keys expected in the Examples' features associated with sparse values.
dense_keys A list of Tensor objects with type string. A list of Ndense string Tensors (scalars). The keys expected in the Examples' features associated with dense values.
dense_defaults A list of Tensor objects with types from: float32, int64, string. A list of Ndense Tensors (some may be empty). dense_defaults[j] provides default values when the example's feature_map lacks dense_key[j]. If an empty Tensor is provided for dense_defaults[j], then the Feature dense_keys[j] is required. The input type is inferred from dense_defaults[j], even when it's empty. If dense_defaults[j] is not empty, and dense_shapes[j] is fully defined, then the shape of dense_defaults[j] must match that of dense_shapes[j]. If dense_shapes[j] has an undefined major dimension (variable strides dense feature), dense_defaults[j] must contain a single element: the padding element.
sparse_types A list of tf.DTypes from: tf.float32, tf.int64, tf.string. A list of Nsparse types; the data types of data in each Feature given in sparse_keys. Currently the ParseExample supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).
dense_shapes A list of shapes (each a tf.TensorShape or list of ints). A list of Ndense shapes; the shapes of data in each Feature given in dense_keys. The number of elements in the Feature corresponding to dense_key[j] must always equal dense_shapes[j].NumEntries(). If dense_shapes[j] == (D0, D1, ..., DN) then the shape of output Tensor dense_values[j] will be (|serialized|, D0, D1, ..., DN): The dense outputs are just the inputs row-stacked by batch. This works for dense_shapes[j] = (-1, D1, ..., DN). In this case the shape of the output Tensor dense_values[j] will be (|serialized|, M, D1, .., DN), where M is the maximum number of blocks of elements of length D1 * .... * DN, across all minibatch entries in the input. Any minibatch entry with less than M blocks of elements of length D1 * ... * DN will be padded with the corresponding default_value scalar element along the second dimension.
name A name for the operation (optional).
Returns A tuple of Tensor objects (sparse_indices, sparse_values, sparse_shapes, dense_values). sparse_indices A list with the same length as sparse_keys of Tensor objects with type int64.
sparse_values A list of Tensor objects of type sparse_types.
sparse_shapes A list with the same length as sparse_keys of Tensor objects with type int64.
dense_values A list of Tensor objects. Has the same type as dense_defaults. | tensorflow.raw_ops.parseexample |
tf.raw_ops.ParseExampleDataset Transforms input_dataset containing Example protos as vectors of DT_STRING into a dataset of Tensor or SparseTensor objects representing the parsed features. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParseExampleDataset
tf.raw_ops.ParseExampleDataset(
input_dataset, num_parallel_calls, dense_defaults, sparse_keys, dense_keys,
sparse_types, dense_shapes, output_types, output_shapes, sloppy=False,
ragged_keys=[], ragged_value_types=[], ragged_split_types=[], name=None
)
Args
input_dataset A Tensor of type variant.
num_parallel_calls A Tensor of type int64.
dense_defaults A list of Tensor objects with types from: float32, int64, string. A dict mapping string keys to Tensors. The keys of the dict must match the dense_keys of the feature.
sparse_keys A list of strings. A list of string keys in the examples features. The results for these keys will be returned as SparseTensor objects.
dense_keys A list of strings. A list of Ndense string Tensors (scalars). The keys expected in the Examples features associated with dense values.
sparse_types A list of tf.DTypes from: tf.float32, tf.int64, tf.string. A list of DTypes of the same length as sparse_keys. Only tf.float32 (FloatList), tf.int64 (Int64List), and tf.string (BytesList) are supported.
dense_shapes A list of shapes (each a tf.TensorShape or list of ints). List of tuples with the same length as dense_keys. The shape of the data for each dense feature referenced by dense_keys. Required for any input tensors identified by dense_keys. Must be either fully defined, or may contain an unknown first dimension. An unknown first dimension means the feature is treated as having a variable number of blocks, and the output shape along this dimension is considered unknown at graph build time. Padding is applied for minibatch elements smaller than the maximum number of blocks for the given feature along this dimension.
output_types A list of tf.DTypes that has length >= 1. The type list for the return values.
output_shapes A list of shapes (each a tf.TensorShape or list of ints) that has length >= 1. The list of shapes being produced.
sloppy An optional bool. Defaults to False.
ragged_keys An optional list of strings. Defaults to [].
ragged_value_types An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to [].
ragged_split_types An optional list of tf.DTypes from: tf.int32, tf.int64. Defaults to [].
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.parseexampledataset |
tf.raw_ops.ParseExampleDatasetV2 Transforms input_dataset containing Example protos as vectors of DT_STRING into a dataset of Tensor or SparseTensor objects representing the parsed features. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParseExampleDatasetV2
tf.raw_ops.ParseExampleDatasetV2(
input_dataset, num_parallel_calls, dense_defaults, sparse_keys, dense_keys,
sparse_types, dense_shapes, output_types, output_shapes,
deterministic='default', ragged_keys=[], ragged_value_types=[],
ragged_split_types=[], name=None
)
Args
input_dataset A Tensor of type variant.
num_parallel_calls A Tensor of type int64.
dense_defaults A list of Tensor objects with types from: float32, int64, string. A dict mapping string keys to Tensors. The keys of the dict must match the dense_keys of the feature.
sparse_keys A list of strings. A list of string keys in the examples features. The results for these keys will be returned as SparseTensor objects.
dense_keys A list of strings. A list of Ndense string Tensors (scalars). The keys expected in the Examples features associated with dense values.
sparse_types A list of tf.DTypes from: tf.float32, tf.int64, tf.string. A list of DTypes of the same length as sparse_keys. Only tf.float32 (FloatList), tf.int64 (Int64List), and tf.string (BytesList) are supported.
dense_shapes A list of shapes (each a tf.TensorShape or list of ints). List of tuples with the same length as dense_keys. The shape of the data for each dense feature referenced by dense_keys. Required for any input tensors identified by dense_keys. Must be either fully defined, or may contain an unknown first dimension. An unknown first dimension means the feature is treated as having a variable number of blocks, and the output shape along this dimension is considered unknown at graph build time. Padding is applied for minibatch elements smaller than the maximum number of blocks for the given feature along this dimension.
output_types A list of tf.DTypes that has length >= 1. The type list for the return values.
output_shapes A list of shapes (each a tf.TensorShape or list of ints) that has length >= 1. The list of shapes being produced.
deterministic An optional string. Defaults to "default". A string indicating the op-level determinism to use. Deterministic controls whether the dataset is allowed to return elements out of order if the next element to be returned isn't available, but a later element is. Options are "true", "false", and "default". "default" indicates that determinism should be decided by the experimental_deterministic parameter of tf.data.Options.
ragged_keys An optional list of strings. Defaults to [].
ragged_value_types An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to [].
ragged_split_types An optional list of tf.DTypes from: tf.int32, tf.int64. Defaults to [].
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.parseexampledatasetv2 |
tf.raw_ops.ParseExampleV2 Transforms a vector of tf.Example protos (as strings) into typed tensors. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParseExampleV2
tf.raw_ops.ParseExampleV2(
serialized, names, sparse_keys, dense_keys, ragged_keys, dense_defaults,
num_sparse, sparse_types, ragged_value_types, ragged_split_types, dense_shapes,
name=None
)
Args
serialized A Tensor of type string. A scalar or vector containing binary serialized Example protos.
names A Tensor of type string. A tensor containing the names of the serialized protos. Corresponds 1:1 with the serialized tensor. May contain, for example, table key (descriptive) names for the corresponding serialized protos. These are purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty vector if no names are available. If non-empty, this tensor must have the same shape as "serialized".
sparse_keys A Tensor of type string. Vector of strings. The keys expected in the Examples' features associated with sparse values.
dense_keys A Tensor of type string. Vector of strings. The keys expected in the Examples' features associated with dense values.
ragged_keys A Tensor of type string. Vector of strings. The keys expected in the Examples' features associated with ragged values.
dense_defaults A list of Tensor objects with types from: float32, int64, string. A list of Tensors (some may be empty). Corresponds 1:1 with dense_keys. dense_defaults[j] provides default values when the example's feature_map lacks dense_key[j]. If an empty Tensor is provided for dense_defaults[j], then the Feature dense_keys[j] is required. The input type is inferred from dense_defaults[j], even when it's empty. If dense_defaults[j] is not empty, and dense_shapes[j] is fully defined, then the shape of dense_defaults[j] must match that of dense_shapes[j]. If dense_shapes[j] has an undefined major dimension (variable strides dense feature), dense_defaults[j] must contain a single element: the padding element.
num_sparse An int that is >= 0. The number of sparse keys.
sparse_types A list of tf.DTypes from: tf.float32, tf.int64, tf.string. A list of num_sparse types; the data types of data in each Feature given in sparse_keys. Currently the ParseExample supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).
ragged_value_types A list of tf.DTypes from: tf.float32, tf.int64, tf.string. A list of num_ragged types; the data types of data in each Feature given in ragged_keys (where num_ragged = sparse_keys.size()). Currently the ParseExample supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).
ragged_split_types A list of tf.DTypes from: tf.int32, tf.int64. A list of num_ragged types; the data types of row_splits in each Feature given in ragged_keys (where num_ragged = sparse_keys.size()). May be DT_INT32 or DT_INT64.
dense_shapes A list of shapes (each a tf.TensorShape or list of ints). A list of num_dense shapes; the shapes of data in each Feature given in dense_keys (where num_dense = dense_keys.size()). The number of elements in the Feature corresponding to dense_key[j] must always equal dense_shapes[j].NumEntries(). If dense_shapes[j] == (D0, D1, ..., DN) then the shape of output Tensor dense_values[j] will be (|serialized|, D0, D1, ..., DN): The dense outputs are just the inputs row-stacked by batch. This works for dense_shapes[j] = (-1, D1, ..., DN). In this case the shape of the output Tensor dense_values[j] will be (|serialized|, M, D1, .., DN), where M is the maximum number of blocks of elements of length D1 * .... * DN, across all minibatch entries in the input. Any minibatch entry with less than M blocks of elements of length D1 * ... * DN will be padded with the corresponding default_value scalar element along the second dimension.
name A name for the operation (optional).
Returns A tuple of Tensor objects (sparse_indices, sparse_values, sparse_shapes, dense_values, ragged_values, ragged_row_splits). sparse_indices A list of num_sparse Tensor objects with type int64.
sparse_values A list of Tensor objects of type sparse_types.
sparse_shapes A list of num_sparse Tensor objects with type int64.
dense_values A list of Tensor objects. Has the same type as dense_defaults.
ragged_values A list of Tensor objects of type ragged_value_types.
ragged_row_splits A list of Tensor objects of type ragged_split_types. | tensorflow.raw_ops.parseexamplev2 |
tf.raw_ops.ParseSequenceExample Transforms a vector of brain.SequenceExample protos (as strings) into typed tensors. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParseSequenceExample
tf.raw_ops.ParseSequenceExample(
serialized, debug_name, context_dense_defaults,
feature_list_dense_missing_assumed_empty, context_sparse_keys,
context_dense_keys, feature_list_sparse_keys, feature_list_dense_keys,
Ncontext_sparse=0, Ncontext_dense=0, Nfeature_list_sparse=0,
Nfeature_list_dense=0, context_sparse_types=[], feature_list_dense_types=[],
context_dense_shapes=[], feature_list_sparse_types=[],
feature_list_dense_shapes=[], name=None
)
Args
serialized A Tensor of type string. A vector containing binary serialized SequenceExample protos.
debug_name A Tensor of type string. A vector containing the names of the serialized protos. May contain, for example, table key (descriptive) name for the corresponding serialized proto. This is purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty vector if no name is available.
context_dense_defaults A list of Tensor objects with types from: float32, int64, string. A list of Ncontext_dense Tensors (some may be empty). context_dense_defaults[j] provides default values when the SequenceExample's context map lacks context_dense_key[j]. If an empty Tensor is provided for context_dense_defaults[j], then the Feature context_dense_keys[j] is required. The input type is inferred from context_dense_defaults[j], even when it's empty. If context_dense_defaults[j] is not empty, its shape must match context_dense_shapes[j].
feature_list_dense_missing_assumed_empty A list of strings. A vector listing the FeatureList keys which may be missing from the SequenceExamples. If the associated FeatureList is missing, it is treated as empty. By default, any FeatureList not listed in this vector must exist in the SequenceExamples.
context_sparse_keys A list of strings. A list of Ncontext_sparse string Tensors (scalars). The keys expected in the Examples' features associated with context_sparse values.
context_dense_keys A list of strings. A list of Ncontext_dense string Tensors (scalars). The keys expected in the SequenceExamples' context features associated with dense values.
feature_list_sparse_keys A list of strings. A list of Nfeature_list_sparse string Tensors (scalars). The keys expected in the FeatureLists associated with sparse values.
feature_list_dense_keys A list of strings. A list of Nfeature_list_dense string Tensors (scalars). The keys expected in the SequenceExamples' feature_lists associated with lists of dense values.
Ncontext_sparse An optional int that is >= 0. Defaults to 0.
Ncontext_dense An optional int that is >= 0. Defaults to 0.
Nfeature_list_sparse An optional int that is >= 0. Defaults to 0.
Nfeature_list_dense An optional int that is >= 0. Defaults to 0.
context_sparse_types An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to []. A list of Ncontext_sparse types; the data types of data in each context Feature given in context_sparse_keys. Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).
feature_list_dense_types An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to [].
context_dense_shapes An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to []. A list of Ncontext_dense shapes; the shapes of data in each context Feature given in context_dense_keys. The number of elements in the Feature corresponding to context_dense_key[j] must always equal context_dense_shapes[j].NumEntries(). The shape of context_dense_values[j] will match context_dense_shapes[j].
feature_list_sparse_types An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to []. A list of Nfeature_list_sparse types; the data types of data in each FeatureList given in feature_list_sparse_keys. Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).
feature_list_dense_shapes An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to []. A list of Nfeature_list_dense shapes; the shapes of data in each FeatureList given in feature_list_dense_keys. The shape of each Feature in the FeatureList corresponding to feature_list_dense_key[j] must always equal feature_list_dense_shapes[j].NumEntries().
name A name for the operation (optional).
Returns A tuple of Tensor objects (context_sparse_indices, context_sparse_values, context_sparse_shapes, context_dense_values, feature_list_sparse_indices, feature_list_sparse_values, feature_list_sparse_shapes, feature_list_dense_values, feature_list_dense_lengths). context_sparse_indices A list of Ncontext_sparse Tensor objects with type int64.
context_sparse_values A list of Tensor objects of type context_sparse_types.
context_sparse_shapes A list of Ncontext_sparse Tensor objects with type int64.
context_dense_values A list of Tensor objects. Has the same type as context_dense_defaults.
feature_list_sparse_indices A list of Nfeature_list_sparse Tensor objects with type int64.
feature_list_sparse_values A list of Tensor objects of type feature_list_sparse_types.
feature_list_sparse_shapes A list of Nfeature_list_sparse Tensor objects with type int64.
feature_list_dense_values A list of Tensor objects of type feature_list_dense_types.
feature_list_dense_lengths A list of Nfeature_list_dense Tensor objects with type int64. | tensorflow.raw_ops.parsesequenceexample |
tf.raw_ops.ParseSequenceExampleV2 Transforms a vector of tf.io.SequenceExample protos (as strings) into View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParseSequenceExampleV2
tf.raw_ops.ParseSequenceExampleV2(
serialized, debug_name, context_sparse_keys, context_dense_keys,
context_ragged_keys, feature_list_sparse_keys, feature_list_dense_keys,
feature_list_ragged_keys, feature_list_dense_missing_assumed_empty,
context_dense_defaults, Ncontext_sparse=0, context_sparse_types=[],
context_ragged_value_types=[], context_ragged_split_types=[],
context_dense_shapes=[], Nfeature_list_sparse=0, Nfeature_list_dense=0,
feature_list_dense_types=[], feature_list_sparse_types=[],
feature_list_ragged_value_types=[], feature_list_ragged_split_types=[],
feature_list_dense_shapes=[], name=None
)
typed tensors. Args: serialized: A Tensor of type string. A scalar or vector containing binary serialized SequenceExample protos. debug_name: A Tensor of type string. A scalar or vector containing the names of the serialized protos. May contain, for example, table key (descriptive) name for the corresponding serialized proto. This is purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty vector if no name is available. context_sparse_keys: A Tensor of type string. The keys expected in the Examples' features associated with context_sparse values. context_dense_keys: A Tensor of type string. The keys expected in the SequenceExamples' context features associated with dense values. context_ragged_keys: A Tensor of type string. The keys expected in the Examples' features associated with context_ragged values. feature_list_sparse_keys: A Tensor of type string. The keys expected in the FeatureLists associated with sparse values. feature_list_dense_keys: A Tensor of type string. The keys expected in the SequenceExamples' feature_lists associated with lists of dense values. feature_list_ragged_keys: A Tensor of type string. The keys expected in the FeatureLists associated with ragged values. feature_list_dense_missing_assumed_empty: A Tensor of type bool. A vector corresponding 1:1 with feature_list_dense_keys, indicating which features may be missing from the SequenceExamples. If the associated FeatureList is missing, it is treated as empty. context_dense_defaults: A list of Tensor objects with types from: float32, int64, string. A list of Ncontext_dense Tensors (some may be empty). context_dense_defaults[j] provides default values when the SequenceExample's context map lacks context_dense_key[j]. If an empty Tensor is provided for context_dense_defaults[j], then the Feature context_dense_keys[j] is required. The input type is inferred from context_dense_defaults[j], even when it's empty. If context_dense_defaults[j] is not empty, its shape must match context_dense_shapes[j]. Ncontext_sparse: An optional int that is >= 0. Defaults to 0. context_sparse_types: An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to []. A list of Ncontext_sparse types; the data types of data in each context Feature given in context_sparse_keys. Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList). context_ragged_value_types: An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to []. RaggedTensor.value dtypes for the ragged context features. context_ragged_split_types: An optional list of tf.DTypes from: tf.int32, tf.int64. Defaults to []. RaggedTensor.row_split dtypes for the ragged context features. context_dense_shapes: An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to []. A list of Ncontext_dense shapes; the shapes of data in each context Feature given in context_dense_keys. The number of elements in the Feature corresponding to context_dense_key[j] must always equal context_dense_shapes[j].NumEntries(). The shape of context_dense_values[j] will match context_dense_shapes[j]. Nfeature_list_sparse: An optional int that is >= 0. Defaults to 0. Nfeature_list_dense: An optional int that is >= 0. Defaults to 0. feature_list_dense_types: An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to []. feature_list_sparse_types: An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to []. A list of Nfeature_list_sparse types; the data types of data in each FeatureList given in feature_list_sparse_keys. Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList). feature_list_ragged_value_types: An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to []. RaggedTensor.value dtypes for the ragged FeatureList features. feature_list_ragged_split_types: An optional list of tf.DTypes from: tf.int32, tf.int64. Defaults to []. RaggedTensor.row_split dtypes for the ragged FeatureList features. feature_list_dense_shapes: An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to []. A list of Nfeature_list_dense shapes; the shapes of data in each FeatureList given in feature_list_dense_keys. The shape of each Feature in the FeatureList corresponding to feature_list_dense_key[j] must always equal feature_list_dense_shapes[j].NumEntries(). name: A name for the operation (optional). Returns: A tuple of Tensor objects (context_sparse_indices, context_sparse_values, context_sparse_shapes, context_dense_values, context_ragged_values, context_ragged_row_splits, feature_list_sparse_indices, feature_list_sparse_values, feature_list_sparse_shapes, feature_list_dense_values, feature_list_dense_lengths, feature_list_ragged_values, feature_list_ragged_outer_splits, feature_list_ragged_inner_splits). context_sparse_indices: A list of `Ncontext_sparse` `Tensor` objects with type `int64`.
context_sparse_values: A list of `Tensor` objects of type `context_sparse_types`.
context_sparse_shapes: A list of `Ncontext_sparse` `Tensor` objects with type `int64`.
context_dense_values: A list of `Tensor` objects. Has the same type as `context_dense_defaults`.
context_ragged_values: A list of `Tensor` objects of type `context_ragged_value_types`.
context_ragged_row_splits: A list of `Tensor` objects of type `context_ragged_split_types`.
feature_list_sparse_indices: A list of `Nfeature_list_sparse` `Tensor` objects with type `int64`.
feature_list_sparse_values: A list of `Tensor` objects of type `feature_list_sparse_types`.
feature_list_sparse_shapes: A list of `Nfeature_list_sparse` `Tensor` objects with type `int64`.
feature_list_dense_values: A list of `Tensor` objects of type `feature_list_dense_types`.
feature_list_dense_lengths: A list of `Nfeature_list_dense` `Tensor` objects with type `int64`.
feature_list_ragged_values: A list of `Tensor` objects of type `feature_list_ragged_value_types`.
feature_list_ragged_outer_splits: A list of `Tensor` objects of type `feature_list_ragged_split_types`.
feature_list_ragged_inner_splits: A list of `Tensor` objects of type `feature_list_ragged_split_types`. | tensorflow.raw_ops.parsesequenceexamplev2 |
tf.raw_ops.ParseSingleExample Transforms a tf.Example proto (as a string) into typed tensors. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParseSingleExample
tf.raw_ops.ParseSingleExample(
serialized, dense_defaults, num_sparse, sparse_keys, dense_keys, sparse_types,
dense_shapes, name=None
)
Args
serialized A Tensor of type string. A vector containing a batch of binary serialized Example protos.
dense_defaults A list of Tensor objects with types from: float32, int64, string. A list of Tensors (some may be empty), whose length matches the length of dense_keys. dense_defaults[j] provides default values when the example's feature_map lacks dense_key[j]. If an empty Tensor is provided for dense_defaults[j], then the Feature dense_keys[j] is required. The input type is inferred from dense_defaults[j], even when it's empty. If dense_defaults[j] is not empty, and dense_shapes[j] is fully defined, then the shape of dense_defaults[j] must match that of dense_shapes[j]. If dense_shapes[j] has an undefined major dimension (variable strides dense feature), dense_defaults[j] must contain a single element: the padding element.
num_sparse An int that is >= 0. The number of sparse features to be parsed from the example. This must match the lengths of sparse_keys and sparse_types.
sparse_keys A list of strings. A list of num_sparse strings. The keys expected in the Examples' features associated with sparse values.
dense_keys A list of strings. The keys expected in the Examples' features associated with dense values.
sparse_types A list of tf.DTypes from: tf.float32, tf.int64, tf.string. A list of num_sparse types; the data types of data in each Feature given in sparse_keys. Currently the ParseSingleExample op supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).
dense_shapes A list of shapes (each a tf.TensorShape or list of ints). The shapes of data in each Feature given in dense_keys. The length of this list must match the length of dense_keys. The number of elements in the Feature corresponding to dense_key[j] must always equal dense_shapes[j].NumEntries(). If dense_shapes[j] == (D0, D1, ..., DN) then the shape of output Tensor dense_values[j] will be (D0, D1, ..., DN): In the case dense_shapes[j] = (-1, D1, ..., DN), the shape of the output Tensor dense_values[j] will be (M, D1, .., DN), where M is the number of blocks of elements of length D1 * .... * DN, in the input.
name A name for the operation (optional).
Returns A tuple of Tensor objects (sparse_indices, sparse_values, sparse_shapes, dense_values). sparse_indices A list of num_sparse Tensor objects with type int64.
sparse_values A list of Tensor objects of type sparse_types.
sparse_shapes A list of num_sparse Tensor objects with type int64.
dense_values A list of Tensor objects. Has the same type as dense_defaults. | tensorflow.raw_ops.parsesingleexample |
tf.raw_ops.ParseSingleSequenceExample Transforms a scalar brain.SequenceExample proto (as strings) into typed tensors. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParseSingleSequenceExample
tf.raw_ops.ParseSingleSequenceExample(
serialized, feature_list_dense_missing_assumed_empty, context_sparse_keys,
context_dense_keys, feature_list_sparse_keys, feature_list_dense_keys,
context_dense_defaults, debug_name, context_sparse_types=[],
feature_list_dense_types=[], context_dense_shapes=[],
feature_list_sparse_types=[], feature_list_dense_shapes=[], name=None
)
Args
serialized A Tensor of type string. A scalar containing a binary serialized SequenceExample proto.
feature_list_dense_missing_assumed_empty A Tensor of type string. A vector listing the FeatureList keys which may be missing from the SequenceExample. If the associated FeatureList is missing, it is treated as empty. By default, any FeatureList not listed in this vector must exist in the SequenceExample.
context_sparse_keys A list of Tensor objects with type string. A list of Ncontext_sparse string Tensors (scalars). The keys expected in the Examples' features associated with context_sparse values.
context_dense_keys A list of Tensor objects with type string. A list of Ncontext_dense string Tensors (scalars). The keys expected in the SequenceExamples' context features associated with dense values.
feature_list_sparse_keys A list of Tensor objects with type string. A list of Nfeature_list_sparse string Tensors (scalars). The keys expected in the FeatureLists associated with sparse values.
feature_list_dense_keys A list of Tensor objects with type string. A list of Nfeature_list_dense string Tensors (scalars). The keys expected in the SequenceExamples' feature_lists associated with lists of dense values.
context_dense_defaults A list of Tensor objects with types from: float32, int64, string. A list of Ncontext_dense Tensors (some may be empty). context_dense_defaults[j] provides default values when the SequenceExample's context map lacks context_dense_key[j]. If an empty Tensor is provided for context_dense_defaults[j], then the Feature context_dense_keys[j] is required. The input type is inferred from context_dense_defaults[j], even when it's empty. If context_dense_defaults[j] is not empty, its shape must match context_dense_shapes[j].
debug_name A Tensor of type string. A scalar containing the name of the serialized proto. May contain, for example, table key (descriptive) name for the corresponding serialized proto. This is purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty scalar if no name is available.
context_sparse_types An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to []. A list of Ncontext_sparse types; the data types of data in each context Feature given in context_sparse_keys. Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).
feature_list_dense_types An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to [].
context_dense_shapes An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to []. A list of Ncontext_dense shapes; the shapes of data in each context Feature given in context_dense_keys. The number of elements in the Feature corresponding to context_dense_key[j] must always equal context_dense_shapes[j].NumEntries(). The shape of context_dense_values[j] will match context_dense_shapes[j].
feature_list_sparse_types An optional list of tf.DTypes from: tf.float32, tf.int64, tf.string. Defaults to []. A list of Nfeature_list_sparse types; the data types of data in each FeatureList given in feature_list_sparse_keys. Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), DT_INT64 (Int64List), and DT_STRING (BytesList).
feature_list_dense_shapes An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to []. A list of Nfeature_list_dense shapes; the shapes of data in each FeatureList given in feature_list_dense_keys. The shape of each Feature in the FeatureList corresponding to feature_list_dense_key[j] must always equal feature_list_dense_shapes[j].NumEntries().
name A name for the operation (optional).
Returns A tuple of Tensor objects (context_sparse_indices, context_sparse_values, context_sparse_shapes, context_dense_values, feature_list_sparse_indices, feature_list_sparse_values, feature_list_sparse_shapes, feature_list_dense_values). context_sparse_indices A list with the same length as context_sparse_keys of Tensor objects with type int64.
context_sparse_values A list of Tensor objects of type context_sparse_types.
context_sparse_shapes A list with the same length as context_sparse_keys of Tensor objects with type int64.
context_dense_values A list of Tensor objects. Has the same type as context_dense_defaults.
feature_list_sparse_indices A list with the same length as feature_list_sparse_keys of Tensor objects with type int64.
feature_list_sparse_values A list of Tensor objects of type feature_list_sparse_types.
feature_list_sparse_shapes A list with the same length as feature_list_sparse_keys of Tensor objects with type int64.
feature_list_dense_values A list of Tensor objects of type feature_list_dense_types. | tensorflow.raw_ops.parsesinglesequenceexample |
tf.raw_ops.ParseTensor Transforms a serialized tensorflow.TensorProto proto into a Tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ParseTensor
tf.raw_ops.ParseTensor(
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. | tensorflow.raw_ops.parsetensor |
tf.raw_ops.PartitionedCall returns f(inputs), where f's body is placed and partitioned. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PartitionedCall
tf.raw_ops.PartitionedCall(
args, Tout, f, config='', config_proto='',
executor_type='', name=None
)
Args
args A list of Tensor objects. A list of input tensors.
Tout A list of tf.DTypes. A list of output types.
f A function decorated with @Defun. A function that takes 'args', a list of tensors, and returns 'output', another list of tensors. Input and output types are specified by 'Tin' and 'Tout'. The function body of f will be placed and partitioned across devices, setting this op apart from the regular Call op.
config An optional string. Defaults to "".
config_proto An optional string. Defaults to "".
executor_type An optional string. Defaults to "".
name A name for the operation (optional).
Returns A list of Tensor objects of type Tout. | tensorflow.raw_ops.partitionedcall |
tf.raw_ops.Placeholder A placeholder op for a value that will be fed into the computation. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Placeholder
tf.raw_ops.Placeholder(
dtype, shape=None, name=None
)
N.B. This operation will fail with an error if it is executed. It is intended as a way to represent a value that will always be fed, and to provide attrs that enable the fed value to be checked at runtime.
Args
dtype A tf.DType. The type of elements in the tensor.
shape An optional tf.TensorShape or list of ints. Defaults to None. (Optional) The shape of the tensor. If the shape has 0 dimensions, the shape is unconstrained.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.placeholder |
tf.raw_ops.PlaceholderV2 A placeholder op for a value that will be fed into the computation. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PlaceholderV2
tf.raw_ops.PlaceholderV2(
dtype, shape, name=None
)
N.B. This operation will fail with an error if it is executed. It is intended as a way to represent a value that will always be fed, and to provide attrs that enable the fed value to be checked at runtime.
Args
dtype A tf.DType. The type of elements in the tensor.
shape A tf.TensorShape or list of ints. The shape of the tensor. The shape can be any partially-specified shape. To be unconstrained, pass in a shape with unknown rank.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.placeholderv2 |
tf.raw_ops.PlaceholderWithDefault A placeholder op that passes through input when its output is not fed. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PlaceholderWithDefault
tf.raw_ops.PlaceholderWithDefault(
input, shape, name=None
)
Args
input A Tensor. The default value to produce when output is not fed.
shape A tf.TensorShape or list of ints. The (possibly partial) shape of the tensor.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.placeholderwithdefault |
tf.raw_ops.Polygamma Compute the polygamma function \(\psi^{(n)}(x)\). View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Polygamma
tf.raw_ops.Polygamma(
a, x, name=None
)
The polygamma function is defined as: \(\psi^{(a)}(x) = \frac{d^a}{dx^a} \psi(x)\) where \(\psi(x)\) is the digamma function. The polygamma function is defined only for non-negative integer orders \a\.
Args
a A Tensor. Must be one of the following types: float32, float64.
x A Tensor. Must have the same type as a.
name A name for the operation (optional).
Returns A Tensor. Has the same type as a. | tensorflow.raw_ops.polygamma |
tf.raw_ops.PopulationCount Computes element-wise population count (a.k.a. popcount, bitsum, bitcount). View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PopulationCount
tf.raw_ops.PopulationCount(
x, name=None
)
For each entry in x, calculates the number of 1 (on) bits in the binary representation of that entry.
Note: It is more efficient to first tf.bitcast your tensors into int32 or int64 and perform the bitcount on the result, than to feed in 8- or 16-bit inputs and then aggregate the resulting counts.
Args
x A Tensor. Must be one of the following types: int8, int16, int32, int64, uint8, uint16, uint32, uint64.
name A name for the operation (optional).
Returns A Tensor of type uint8. | tensorflow.raw_ops.populationcount |
tf.raw_ops.Pow Computes the power of one value to another. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Pow
tf.raw_ops.Pow(
x, y, name=None
)
Given a tensor x and a tensor y, this operation computes \(x^y\) for corresponding elements in x and y. For example: # tensor 'x' is [[2, 2]], [3, 3]]
# tensor 'y' is [[8, 16], [2, 3]]
tf.pow(x, y) ==> [[256, 65536], [9, 27]]
Args
x A Tensor. Must be one of the following types: bfloat16, float32, half, float64, 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. | tensorflow.raw_ops.pow |
tf.raw_ops.PrefetchDataset Creates a dataset that asynchronously prefetches elements from input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PrefetchDataset
tf.raw_ops.PrefetchDataset(
input_dataset, buffer_size, output_types, output_shapes, slack_period=0,
legacy_autotune=True, buffer_size_min=0, name=None
)
Args
input_dataset A Tensor of type variant.
buffer_size A Tensor of type int64. The maximum number of elements to buffer in an iterator over this dataset.
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.
slack_period An optional int. Defaults to 0.
legacy_autotune An optional bool. Defaults to True.
buffer_size_min An optional int. Defaults to 0.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.prefetchdataset |
tf.raw_ops.Prelinearize An op which linearizes one Tensor value to an opaque variant tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Prelinearize
tf.raw_ops.Prelinearize(
input, shape=[], layout=[], name=None
)
Args
input A Tensor. A tensor that will be linearized.
shape An optional tf.TensorShape or list of ints. Defaults to []. The shape of the tensor.
layout An optional list of ints. Defaults to []. A vector holding the requested layout in minor-to-major sequence. If a layout attribute is passed but its values are all -1 the layout will be computed by the infeed operation.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.prelinearize |
tf.raw_ops.PrelinearizeTuple An op which linearizes multiple Tensor values to an opaque variant tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PrelinearizeTuple
tf.raw_ops.PrelinearizeTuple(
inputs, shapes, layouts=[], name=None
)
Args
inputs A list of Tensor objects. A list of tensors that will be provided using the infeed mechanism.
shapes A list of shapes (each a tf.TensorShape or list of ints). The shapes of each tensor in inputs.
layouts An optional list of ints. Defaults to []. A vector holding the requested layout in minor-to-major sequence for all the tuple shapes in the order the shapes appear in the "shapes" input. The layout elements for a sub-shape can be set to -1 in which case the corresponding layout will be computed by the infeed operation.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.prelinearizetuple |
tf.raw_ops.PreventGradient An identity op that triggers an error if a gradient is requested. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PreventGradient
tf.raw_ops.PreventGradient(
input, message='', name=None
)
When executed in a graph, this op outputs its input tensor as-is. When building ops to compute gradients, the TensorFlow gradient system will return an error when trying to lookup the gradient of this op, because no gradient must ever be registered for this function. This op exists to prevent subtle bugs from silently returning unimplemented gradients in some corner cases.
Args
input A Tensor. any tensor.
message An optional string. Defaults to "". Will be printed in the error when anyone tries to differentiate this operation.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.preventgradient |
tf.raw_ops.Print Prints a list of tensors. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Print
tf.raw_ops.Print(
input, data, message='', first_n=-1, summarize=3, name=None
)
Passes input through to output and prints data when evaluating.
Args
input A Tensor. The tensor passed to output
data A list of Tensor objects. A list of tensors to print out when op is evaluated.
message An optional string. Defaults to "". A string, prefix of the error message.
first_n An optional int. Defaults to -1. Only log first_n number of times. -1 disables logging.
summarize An optional int. Defaults to 3. Only print this many entries of each tensor.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.print |
tf.raw_ops.PrintV2 Prints a string scalar. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PrintV2
tf.raw_ops.PrintV2(
input, output_stream='stderr', end='\n', name=None
)
Prints a string scalar to the desired output_stream.
Args
input A Tensor of type string. The string scalar to print.
output_stream An optional string. Defaults to "stderr". A string specifying the output stream or logging level to print to.
end An optional string. Defaults to "\n".
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.printv2 |
tf.raw_ops.PriorityQueue A queue that produces elements sorted by the first component value. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PriorityQueue
tf.raw_ops.PriorityQueue(
shapes, component_types=[], capacity=-1, container='',
shared_name='', name=None
)
Note that the PriorityQueue requires the first component of any element to be a scalar int64, in addition to the other elements declared by component_types. Therefore calls to Enqueue and EnqueueMany (resp. Dequeue and DequeueMany) on a PriorityQueue will all require (resp. output) one extra entry in their input (resp. output) lists.
Args
shapes A list of shapes (each a tf.TensorShape or list of ints). The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component_types. If the length of this attr is 0, the shapes of queue elements are not constrained, and only one element may be dequeued at a time.
component_types An optional list of tf.DTypes. Defaults to []. The type of each component in a value.
capacity An optional int. Defaults to -1. The upper bound on the number of elements in this queue. Negative numbers mean no limit.
container An optional string. Defaults to "". If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this queue will be shared under the given name across multiple sessions.
name A name for the operation (optional).
Returns A Tensor of type mutable string. | tensorflow.raw_ops.priorityqueue |
tf.raw_ops.PriorityQueueV2 A queue that produces elements sorted by the first component value. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PriorityQueueV2
tf.raw_ops.PriorityQueueV2(
shapes, component_types=[], capacity=-1, container='',
shared_name='', name=None
)
Note that the PriorityQueue requires the first component of any element to be a scalar int64, in addition to the other elements declared by component_types. Therefore calls to Enqueue and EnqueueMany (resp. Dequeue and DequeueMany) on a PriorityQueue will all require (resp. output) one extra entry in their input (resp. output) lists.
Args
shapes A list of shapes (each a tf.TensorShape or list of ints). The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component_types. If the length of this attr is 0, the shapes of queue elements are not constrained, and only one element may be dequeued at a time.
component_types An optional list of tf.DTypes. Defaults to []. The type of each component in a value.
capacity An optional int. Defaults to -1. The upper bound on the number of elements in this queue. Negative numbers mean no limit.
container An optional string. Defaults to "". If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this queue will be shared under the given name across multiple sessions.
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.priorityqueuev2 |
tf.raw_ops.PrivateThreadPoolDataset Creates a dataset that uses a custom thread pool to compute input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PrivateThreadPoolDataset
tf.raw_ops.PrivateThreadPoolDataset(
input_dataset, num_threads, output_types, output_shapes, name=None
)
Args
input_dataset A Tensor of type variant.
num_threads A Tensor of type int64. Identifies the number of threads to use for the private threadpool.
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. | tensorflow.raw_ops.privatethreadpooldataset |
tf.raw_ops.Prod Computes the product of elements across dimensions of a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Prod
tf.raw_ops.Prod(
input, axis, keep_dims=False, name=None
)
Reduces input along the dimensions given in axis. Unless keep_dims is true, the rank of the tensor is reduced by 1 for each entry in axis. If keep_dims is true, the reduced dimensions are retained with length 1.
Args
input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, complex64, int64, qint8, quint8, qint32, bfloat16, uint16, complex128, half, uint32, uint64. The tensor to reduce.
axis A Tensor. Must be one of the following types: int32, int64. The dimensions to reduce. Must be in the range [-rank(input), rank(input)).
keep_dims An optional bool. Defaults to False. If true, retain reduced dimensions with length 1.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.prod |
tf.raw_ops.PyFunc Invokes a python function to compute func(input)->output. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PyFunc
tf.raw_ops.PyFunc(
input, token, Tout, name=None
)
This operation is considered stateful. For a stateless version, see PyFuncStateless.
Args
input A list of Tensor objects. List of Tensors that will provide input to the Op.
token A string. A token representing a registered python function in this address space.
Tout A list of tf.DTypes. Data types of the outputs from the op. The length of the list specifies the number of outputs.
name A name for the operation (optional).
Returns A list of Tensor objects of type Tout. | tensorflow.raw_ops.pyfunc |
tf.raw_ops.PyFuncStateless A stateless version of PyFunc. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.PyFuncStateless
tf.raw_ops.PyFuncStateless(
input, token, Tout, name=None
)
Args
input A list of Tensor objects.
token A string.
Tout A list of tf.DTypes.
name A name for the operation (optional).
Returns A list of Tensor objects of type Tout. | tensorflow.raw_ops.pyfuncstateless |
tf.raw_ops.Qr Computes the QR decompositions of one or more matrices. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Qr
tf.raw_ops.Qr(
input, full_matrices=False, name=None
)
Computes the QR decomposition of each inner matrix in tensor such that tensor[..., :, :] = q[..., :, :] * r[..., :,:]) Currently, the gradient for the QR decomposition is well-defined only when the first P columns of the inner matrix are linearly independent, where P is the minimum of M and N, the 2 inner-most dimmensions of tensor. # a is a tensor.
# q is a tensor of orthonormal matrices.
# r is a tensor of upper triangular matrices.
q, r = qr(a)
q_full, r_full = qr(a, full_matrices=True)
Args
input A Tensor. Must be one of the following types: float64, float32, half, complex64, complex128. A tensor of shape [..., M, N] whose inner-most 2 dimensions form matrices of size [M, N]. Let P be the minimum of M and N.
full_matrices An optional bool. Defaults to False. If true, compute full-sized q and r. If false (the default), compute only the leading P columns of q.
name A name for the operation (optional).
Returns A tuple of Tensor objects (q, r). q A Tensor. Has the same type as input.
r A Tensor. Has the same type as input. | tensorflow.raw_ops.qr |
tf.raw_ops.QuantizeAndDequantize Use QuantizeAndDequantizeV2 instead. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizeAndDequantize
tf.raw_ops.QuantizeAndDequantize(
input, signed_input=True, num_bits=8, range_given=False, input_min=0,
input_max=0, name=None
)
Args
input A Tensor. Must be one of the following types: bfloat16, half, float32, float64.
signed_input An optional bool. Defaults to True.
num_bits An optional int. Defaults to 8.
range_given An optional bool. Defaults to False.
input_min An optional float. Defaults to 0.
input_max An optional float. Defaults to 0.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.quantizeanddequantize |
tf.raw_ops.QuantizeAndDequantizeV2 Quantizes then dequantizes a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizeAndDequantizeV2
tf.raw_ops.QuantizeAndDequantizeV2(
input, input_min, input_max, signed_input=True, num_bits=8, range_given=False,
round_mode='HALF_TO_EVEN', narrow_range=False, axis=-1, name=None
)
This op simulates the precision loss from the quantized forward pass by: Quantizing the tensor to fixed point numbers, which should match the target quantization method when it is used in inference. Dequantizing it back to floating point numbers for the following ops, most likely matmul. There are different ways to quantize. This version uses only scaling, so 0.0 maps to 0. From the specified 'num_bits' in the quantized output type, it determines minimum and maximum representable quantized values. e.g. [-128, 127] for signed, num_bits = 8, or [0, 255] for unsigned, num_bits = 8. If range_given == False, the initial input_min, input_max will be determined automatically as the minimum and maximum values in the input tensor, otherwise the specified values of input_min, input_max are used.
Note: If the input_min, input_max are specified, they do not need to equal the actual minimum and maximum values in the tensor. e.g. in some cases it may be beneficial to specify these values such that the low probability extremes of the input distribution are clipped.
This op determines the maximum scale_factor that would map the initial [input_min, input_max] range to a range that lies within the representable quantized range. It determines the scale from one of input_min and input_max, then updates the other one to maximize the representable range. e.g. if the output is signed, num_bits = 8, [input_min, input_max] = [-10.0, 5.0]: it would use a scale_factor of -128 / -10.0 = 12.8 In this case, it would update input_max to be 127 / 12.8 = 9.921875 if the output is signed, num_bits = 8, [input_min, input_max] = [-10.0, 10.0]: it would use a scale_factor of 127 / 10.0 = 12.7 In this case, it would update input_min to be 128.0 / 12.7 = -10.07874 if the output is unsigned, input_min is forced to be 0, and only the specified input_max is used. After determining the scale_factor and updating the input range, it applies the following to each value in the 'input' tensor. output = round(clamp(value, input_min, input_max) * scale_factor) / scale_factor. The above round function rounds the value based on the given round_mode.
Args
input A Tensor. Must be one of the following types: bfloat16, half, float32, float64. Tensor to quantize and then dequantize.
input_min A Tensor. Must have the same type as input. If range_given == True, this specifies the minimum input value that needs to be represented, otherwise it is determined from the min value of the input tensor.
input_max A Tensor. Must have the same type as input. If range_given == True, this specifies the maximum input value that needs to be represented, otherwise it is determined from the max value of the input tensor.
signed_input An optional bool. Defaults to True. Whether the quantization is signed or unsigned. (actually this parameter should have been called signed_output)
num_bits An optional int. Defaults to 8. The bitwidth of the quantization.
range_given An optional bool. Defaults to False. Whether the range is given or should be determined from the input tensor.
round_mode An optional string from: "HALF_TO_EVEN", "HALF_UP". Defaults to "HALF_TO_EVEN". The 'round_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents. The following rounding modes are currently supported: HALF_TO_EVEN: this is the default round_mode. HALF_UP: round towards positive. In this mode 7.5 rounds up to 8 and -7.5 rounds up to -7.
narrow_range An optional bool. Defaults to False. If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater. i.e. for 8 bit quantization, the minimum value is -127 instead of -128.
axis An optional int. Defaults to -1. If specified, this axis is treated as a channel or slice axis, and a separate quantization range is used for each channel or slice along this axis.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.quantizeanddequantizev2 |
tf.raw_ops.QuantizeAndDequantizeV3 Quantizes then dequantizes a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizeAndDequantizeV3
tf.raw_ops.QuantizeAndDequantizeV3(
input, input_min, input_max, num_bits, signed_input=True, range_given=True,
narrow_range=False, axis=-1, name=None
)
This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a tensor, so its value can change during training.
Args
input A Tensor. Must be one of the following types: bfloat16, half, float32, float64.
input_min A Tensor. Must have the same type as input.
input_max A Tensor. Must have the same type as input.
num_bits A Tensor of type int32.
signed_input An optional bool. Defaults to True.
range_given An optional bool. Defaults to True.
narrow_range An optional bool. Defaults to False.
axis An optional int. Defaults to -1.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.quantizeanddequantizev3 |
tf.raw_ops.QuantizeAndDequantizeV4 Returns the gradient of QuantizeAndDequantizeV4. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizeAndDequantizeV4
tf.raw_ops.QuantizeAndDequantizeV4(
input, input_min, input_max, signed_input=True, num_bits=8, range_given=False,
round_mode='HALF_TO_EVEN', narrow_range=False, axis=-1, name=None
)
This is almost identical to QuantizeAndDequantizeV2, except that it returns a gradient of 1 for inputs that are within the quantization range, or 0 otherwise.
Args
input A Tensor. Must be one of the following types: bfloat16, half, float32, float64.
input_min A Tensor. Must have the same type as input.
input_max A Tensor. Must have the same type as input.
signed_input An optional bool. Defaults to True.
num_bits An optional int. Defaults to 8.
range_given An optional bool. Defaults to False.
round_mode An optional string from: "HALF_TO_EVEN", "HALF_UP". Defaults to "HALF_TO_EVEN".
narrow_range An optional bool. Defaults to False.
axis An optional int. Defaults to -1.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.quantizeanddequantizev4 |
tf.raw_ops.QuantizeAndDequantizeV4Grad Returns the gradient of QuantizeAndDequantizeV4. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizeAndDequantizeV4Grad
tf.raw_ops.QuantizeAndDequantizeV4Grad(
gradients, input, input_min, input_max, axis=-1, name=None
)
Returns a gradient of 1 for inputs that are within the quantization range, or 0 otherwise.
Args
gradients A Tensor. Must be one of the following types: bfloat16, half, float32, float64.
input A Tensor. Must have the same type as gradients.
input_min A Tensor. Must have the same type as gradients.
input_max A Tensor. Must have the same type as gradients.
axis An optional int. Defaults to -1.
name A name for the operation (optional).
Returns A tuple of Tensor objects (input_backprop, input_min_backprop, input_max_backprop). input_backprop A Tensor. Has the same type as gradients.
input_min_backprop A Tensor. Has the same type as gradients.
input_max_backprop A Tensor. Has the same type as gradients. | tensorflow.raw_ops.quantizeanddequantizev4grad |
tf.raw_ops.QuantizedAdd Returns x + y element-wise, working on quantized buffers. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedAdd
tf.raw_ops.QuantizedAdd(
x, y, min_x, max_x, min_y, max_y, Toutput=tf.dtypes.qint32, name=None
)
Args
x A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
y A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
min_x A Tensor of type float32. The float value that the lowest quantized x value represents.
max_x A Tensor of type float32. The float value that the highest quantized x value represents.
min_y A Tensor of type float32. The float value that the lowest quantized y value represents.
max_y A Tensor of type float32. The float value that the highest quantized y value represents.
Toutput An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32.
name A name for the operation (optional).
Returns A tuple of Tensor objects (z, min_z, max_z). z A Tensor of type Toutput.
min_z A Tensor of type float32.
max_z A Tensor of type float32. | tensorflow.raw_ops.quantizedadd |
tf.raw_ops.QuantizedAvgPool Produces the average pool of the input tensor for quantized types. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedAvgPool
tf.raw_ops.QuantizedAvgPool(
input, min_input, max_input, ksize, strides, padding, name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. 4-D with shape [batch, height, width, channels].
min_input A Tensor of type float32. The float value that the lowest quantized input value represents.
max_input A Tensor of type float32. The float value that the highest quantized input value represents.
ksize A list of ints. The size of the window for each dimension of the input tensor. The length must be 4 to match the number of dimensions of the input.
strides A list of ints. The stride of the sliding window for each dimension of the input tensor. The length must be 4 to match the number of dimensions of the input.
padding A string from: "SAME", "VALID". The type of padding algorithm to use.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor. Has the same type as input.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedavgpool |
tf.raw_ops.QuantizedBatchNormWithGlobalNormalization Quantized Batch normalization. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedBatchNormWithGlobalNormalization
tf.raw_ops.QuantizedBatchNormWithGlobalNormalization(
t, t_min, t_max, m, m_min, m_max, v, v_min, v_max, beta, beta_min, beta_max,
gamma, gamma_min, gamma_max, out_type, variance_epsilon,
scale_after_normalization, name=None
)
This op is deprecated and will be removed in the future. Prefer tf.nn.batch_normalization.
Args
t A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. A 4D input Tensor.
t_min A Tensor of type float32. The value represented by the lowest quantized input.
t_max A Tensor of type float32. The value represented by the highest quantized input.
m A Tensor. Must have the same type as t. A 1D mean Tensor with size matching the last dimension of t. This is the first output from tf.nn.moments, or a saved moving average thereof.
m_min A Tensor of type float32. The value represented by the lowest quantized mean.
m_max A Tensor of type float32. The value represented by the highest quantized mean.
v A Tensor. Must have the same type as t. A 1D variance Tensor with size matching the last dimension of t. This is the second output from tf.nn.moments, or a saved moving average thereof.
v_min A Tensor of type float32. The value represented by the lowest quantized variance.
v_max A Tensor of type float32. The value represented by the highest quantized variance.
beta A Tensor. Must have the same type as t. A 1D beta Tensor with size matching the last dimension of t. An offset to be added to the normalized tensor.
beta_min A Tensor of type float32. The value represented by the lowest quantized offset.
beta_max A Tensor of type float32. The value represented by the highest quantized offset.
gamma A Tensor. Must have the same type as t. A 1D gamma Tensor with size matching the last dimension of t. If "scale_after_normalization" is true, this tensor will be multiplied with the normalized tensor.
gamma_min A Tensor of type float32. The value represented by the lowest quantized gamma.
gamma_max A Tensor of type float32. The value represented by the highest quantized gamma.
out_type A tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16.
variance_epsilon A float. A small float number to avoid dividing by 0.
scale_after_normalization A bool. A bool indicating whether the resulted tensor needs to be multiplied with gamma.
name A name for the operation (optional).
Returns A tuple of Tensor objects (result, result_min, result_max). result A Tensor of type out_type.
result_min A Tensor of type float32.
result_max A Tensor of type float32. | tensorflow.raw_ops.quantizedbatchnormwithglobalnormalization |
tf.raw_ops.QuantizedBiasAdd Adds Tensor 'bias' to Tensor 'input' for Quantized types. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedBiasAdd
tf.raw_ops.QuantizedBiasAdd(
input, bias, min_input, max_input, min_bias, max_bias, out_type, name=None
)
Broadcasts the values of bias on dimensions 0..N-2 of 'input'.
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. A 1D bias Tensor with size matching the last dimension of 'input'.
min_input A Tensor of type float32. The float value that the lowest quantized input value represents.
max_input A Tensor of type float32. The float value that the highest quantized input value represents.
min_bias A Tensor of type float32. The float value that the lowest quantized bias value represents.
max_bias A Tensor of type float32. The float value that the highest quantized bias value represents.
out_type A tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_out, max_out). output A Tensor of type out_type.
min_out A Tensor of type float32.
max_out A Tensor of type float32. | tensorflow.raw_ops.quantizedbiasadd |
tf.raw_ops.QuantizedConcat Concatenates quantized tensors along one dimension. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConcat
tf.raw_ops.QuantizedConcat(
concat_dim, values, input_mins, input_maxes, name=None
)
Args
concat_dim A Tensor of type int32. 0-D. The dimension along which to concatenate. Must be in the range [0, rank(values)).
values A list of at least 2 Tensor objects with the same type. The N Tensors to concatenate. Their ranks and types must match, and their sizes must match in all dimensions except concat_dim.
input_mins A list with the same length as values of Tensor objects with type float32. The minimum scalar values for each of the input tensors.
input_maxes A list with the same length as values of Tensor objects with type float32. The maximum scalar values for each of the input tensors.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, output_min, output_max). output A Tensor. Has the same type as values.
output_min A Tensor of type float32.
output_max A Tensor of type float32. | tensorflow.raw_ops.quantizedconcat |
tf.raw_ops.QuantizedConv2D Computes a 2D convolution given quantized 4D input and filter tensors. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2D
tf.raw_ops.QuantizedConv2D(
input, filter, min_input, max_input, min_filter, max_filter, strides, padding,
out_type=tf.dtypes.qint32, dilations=[1, 1, 1, 1], name=None
)
The inputs are quantized tensors where the lowest value represents the real number of the associated minimum, and the highest represents the maximum. This means that you can only interpret the quantized output in the same way, by taking the returned minimum and maximum values into account.
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. filter's input_depth dimension must match input's depth dimensions.
min_input A Tensor of type float32. The float value that the lowest quantized input value represents.
max_input A Tensor of type float32. The float value that the highest quantized input value represents.
min_filter A Tensor of type float32. The float value that the lowest quantized filter value represents.
max_filter A Tensor of type float32. The float value that the highest quantized filter value represents.
strides A list of ints. The stride of the sliding window for each dimension of the input tensor.
padding A string from: "SAME", "VALID". The type of padding algorithm to use.
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32.
dilations An optional list of ints. Defaults to [1, 1, 1, 1]. 1-D tensor of length 4. The dilation factor for each dimension of input. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of data_format, see above for details. Dilations in the batch and depth dimensions must be 1.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2d |
tf.raw_ops.QuantizedConv2DAndRelu View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DAndRelu
tf.raw_ops.QuantizedConv2DAndRelu(
input, filter, min_input, max_input, min_filter, max_filter, strides, padding,
out_type=tf.dtypes.qint32, dilations=[1, 1, 1, 1], padding_list=[], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dandrelu |
tf.raw_ops.QuantizedConv2DAndReluAndRequantize View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DAndReluAndRequantize
tf.raw_ops.QuantizedConv2DAndReluAndRequantize(
input, filter, min_input, max_input, min_filter, max_filter, min_freezed_output,
max_freezed_output, strides, padding, out_type=tf.dtypes.quint8, dilations=[1,
1, 1, 1], padding_list=[], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
min_freezed_output A Tensor of type float32.
max_freezed_output A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dandreluandrequantize |
tf.raw_ops.QuantizedConv2DAndRequantize View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DAndRequantize
tf.raw_ops.QuantizedConv2DAndRequantize(
input, filter, min_input, max_input, min_filter, max_filter, min_freezed_output,
max_freezed_output, strides, padding, out_type=tf.dtypes.qint8, dilations=[1, 1,
1, 1], padding_list=[], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
min_freezed_output A Tensor of type float32.
max_freezed_output A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint8.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dandrequantize |
tf.raw_ops.QuantizedConv2DPerChannel Computes QuantizedConv2D per channel. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DPerChannel
tf.raw_ops.QuantizedConv2DPerChannel(
input, filter, min_input, max_input, min_filter, max_filter, strides, padding,
out_type=tf.dtypes.qint32, dilations=[1, 1, 1, 1], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original input tensor.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original filter tensor.
min_input A Tensor of type float32. The minimum value of the input tensor
max_input A Tensor of type float32. The maximum value of the input tensor.
min_filter A Tensor of type float32. The minimum value of the filter tensor.
max_filter A Tensor of type float32. The maximum value of the filter tensor.
strides A list of ints. list of stride values.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32. The quantized type of output tensor that needs to be converted.
dilations An optional list of ints. Defaults to [1, 1, 1, 1]. list of dilation values.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dperchannel |
tf.raw_ops.QuantizedConv2DWithBias View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DWithBias
tf.raw_ops.QuantizedConv2DWithBias(
input, filter, bias, min_input, max_input, min_filter, max_filter, strides,
padding, out_type=tf.dtypes.qint32, dilations=[1, 1, 1, 1], padding_list=[],
name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor of type float32.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dwithbias |
tf.raw_ops.QuantizedConv2DWithBiasAndRelu View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DWithBiasAndRelu
tf.raw_ops.QuantizedConv2DWithBiasAndRelu(
input, filter, bias, min_input, max_input, min_filter, max_filter, strides,
padding, out_type=tf.dtypes.qint32, dilations=[1, 1, 1, 1], padding_list=[],
name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor of type float32.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dwithbiasandrelu |
tf.raw_ops.QuantizedConv2DWithBiasAndReluAndRequantize View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DWithBiasAndReluAndRequantize
tf.raw_ops.QuantizedConv2DWithBiasAndReluAndRequantize(
input, filter, bias, min_input, max_input, min_filter, max_filter,
min_freezed_output, max_freezed_output, strides, padding,
out_type=tf.dtypes.quint8, dilations=[1, 1, 1, 1], padding_list=[], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor. Must be one of the following types: float32, qint32.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
min_freezed_output A Tensor of type float32.
max_freezed_output A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dwithbiasandreluandrequantize |
tf.raw_ops.QuantizedConv2DWithBiasAndRequantize View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DWithBiasAndRequantize
tf.raw_ops.QuantizedConv2DWithBiasAndRequantize(
input, filter, bias, min_input, max_input, min_filter, max_filter,
min_freezed_output, max_freezed_output, strides, padding,
out_type=tf.dtypes.qint8, dilations=[1, 1, 1, 1], padding_list=[], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor. Must be one of the following types: float32, qint32.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
min_freezed_output A Tensor of type float32.
max_freezed_output A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint8.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dwithbiasandrequantize |
tf.raw_ops.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize
tf.raw_ops.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(
input, filter, bias, min_input, max_input, min_filter, max_filter,
min_freezed_output, max_freezed_output, summand, min_summand, max_summand,
strides, padding, out_type=tf.dtypes.quint8, dilations=[1, 1, 1, 1],
padding_list=[], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor. Must be one of the following types: float32, qint32.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
min_freezed_output A Tensor of type float32.
max_freezed_output A Tensor of type float32.
summand A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
min_summand A Tensor of type float32.
max_summand A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dwithbiassignedsumandreluandrequantize |
tf.raw_ops.QuantizedConv2DWithBiasSumAndRelu View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DWithBiasSumAndRelu
tf.raw_ops.QuantizedConv2DWithBiasSumAndRelu(
input, filter, bias, min_input, max_input, min_filter, max_filter, summand,
strides, padding, out_type=tf.dtypes.qint32, dilations=[1, 1, 1, 1],
padding_list=[], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor of type float32.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
summand A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dwithbiassumandrelu |
tf.raw_ops.QuantizedConv2DWithBiasSumAndReluAndRequantize View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedConv2DWithBiasSumAndReluAndRequantize
tf.raw_ops.QuantizedConv2DWithBiasSumAndReluAndRequantize(
input, filter, bias, min_input, max_input, min_filter, max_filter,
min_freezed_output, max_freezed_output, summand, min_summand, max_summand,
strides, padding, out_type=tf.dtypes.quint8, dilations=[1, 1, 1, 1],
padding_list=[], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor. Must be one of the following types: float32, qint32.
min_input A Tensor of type float32.
max_input A Tensor of type float32.
min_filter A Tensor of type float32.
max_filter A Tensor of type float32.
min_freezed_output A Tensor of type float32.
max_freezed_output A Tensor of type float32.
summand A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
min_summand A Tensor of type float32.
max_summand A Tensor of type float32.
strides A list of ints.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8.
dilations An optional list of ints. Defaults to [1, 1, 1, 1].
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedconv2dwithbiassumandreluandrequantize |
tf.raw_ops.QuantizedDepthwiseConv2D Computes quantized depthwise Conv2D. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedDepthwiseConv2D
tf.raw_ops.QuantizedDepthwiseConv2D(
input, filter, min_input, max_input, min_filter, max_filter, strides, padding,
out_type=tf.dtypes.qint32, dilations=[1, 1, 1, 1], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original input tensor.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original filter tensor.
min_input A Tensor of type float32. The float value that the minimum quantized input value represents.
max_input A Tensor of type float32. The float value that the maximum quantized input value represents.
min_filter A Tensor of type float32. The float value that the minimum quantized filter value represents.
max_filter A Tensor of type float32. The float value that the maximum quantized filter value represents.
strides A list of ints. List of stride values.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32. The type of the output.
dilations An optional list of ints. Defaults to [1, 1, 1, 1]. List of dilation values.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizeddepthwiseconv2d |
tf.raw_ops.QuantizedDepthwiseConv2DWithBias Computes quantized depthwise Conv2D with Bias. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedDepthwiseConv2DWithBias
tf.raw_ops.QuantizedDepthwiseConv2DWithBias(
input, filter, bias, min_input, max_input, min_filter, max_filter, strides,
padding, out_type=tf.dtypes.qint32, dilations=[1, 1, 1, 1], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original input tensor.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original filter tensor.
bias A Tensor of type float32. The original bias tensor.
min_input A Tensor of type float32. The float value that the minimum quantized input value represents.
max_input A Tensor of type float32. The float value that the maximum quantized input value represents.
min_filter A Tensor of type float32. The float value that the minimum quantized filter value represents.
max_filter A Tensor of type float32. The float value that the maximum quantized filter value represents.
strides A list of ints. List of stride values.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32. The type of the output.
dilations An optional list of ints. Defaults to [1, 1, 1, 1]. List of dilation values.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizeddepthwiseconv2dwithbias |
tf.raw_ops.QuantizedDepthwiseConv2DWithBiasAndRelu Computes quantized depthwise Conv2D with Bias and Relu. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedDepthwiseConv2DWithBiasAndRelu
tf.raw_ops.QuantizedDepthwiseConv2DWithBiasAndRelu(
input, filter, bias, min_input, max_input, min_filter, max_filter, strides,
padding, out_type=tf.dtypes.qint32, dilations=[1, 1, 1, 1], padding_list=[],
name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original input tensor.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original filter tensor.
bias A Tensor of type float32. The original bias tensor.
min_input A Tensor of type float32. The float value that the minimum quantized input value represents.
max_input A Tensor of type float32. The float value that the maximum quantized input value represents.
min_filter A Tensor of type float32. The float value that the minimum quantized filter value represents.
max_filter A Tensor of type float32. The float value that the maximum quantized filter value represents.
strides A list of ints. List of stride values.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32. The type of the output.
dilations An optional list of ints. Defaults to [1, 1, 1, 1]. List of dilation values.
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizeddepthwiseconv2dwithbiasandrelu |
tf.raw_ops.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize Computes quantized depthwise Conv2D with Bias, Relu and Requantize. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize
tf.raw_ops.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(
input, filter, bias, min_input, max_input, min_filter, max_filter,
min_freezed_output, max_freezed_output, strides, padding,
out_type=tf.dtypes.quint8, dilations=[1, 1, 1, 1], padding_list=[], name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original input tensor.
filter A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The original filter tensor.
bias A Tensor. Must be one of the following types: float32, qint32. The original bias tensor.
min_input A Tensor of type float32. The float value that the minimum quantized input value represents.
max_input A Tensor of type float32. The float value that the maximum quantized input value represents.
min_filter A Tensor of type float32. The float value that the minimum quantized filter value represents.
max_filter A Tensor of type float32. The float value that the maximum quantized filter value represents.
min_freezed_output A Tensor of type float32. The minimum float value of the output tensor.
max_freezed_output A Tensor of type float32. The maximum float value of the output tensor.
strides A list of ints. List of stride values.
padding A string from: "SAME", "VALID".
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8. The type of the output.
dilations An optional list of ints. Defaults to [1, 1, 1, 1]. List of dilation values.
padding_list An optional list of ints. Defaults to [].
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor of type out_type.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizeddepthwiseconv2dwithbiasandreluandrequantize |
tf.raw_ops.QuantizedInstanceNorm Quantized Instance normalization. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedInstanceNorm
tf.raw_ops.QuantizedInstanceNorm(
x, x_min, x_max, output_range_given=False, given_y_min=0, given_y_max=0,
variance_epsilon=1e-05, min_separation=0.001, name=None
)
Args
x A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. A 4D input Tensor.
x_min A Tensor of type float32. The value represented by the lowest quantized input.
x_max A Tensor of type float32. The value represented by the highest quantized input.
output_range_given An optional bool. Defaults to False. If True, given_y_min and given_y_min and given_y_max are used as the output range. Otherwise, the implementation computes the output range.
given_y_min An optional float. Defaults to 0. Output in y_min if output_range_given is True.
given_y_max An optional float. Defaults to 0. Output in y_max if output_range_given is True.
variance_epsilon An optional float. Defaults to 1e-05. A small float number to avoid dividing by 0.
min_separation An optional float. Defaults to 0.001. Minimum value of y_max - y_min
name A name for the operation (optional).
Returns A tuple of Tensor objects (y, y_min, y_max). y A Tensor. Has the same type as x.
y_min A Tensor of type float32.
y_max A Tensor of type float32. | tensorflow.raw_ops.quantizedinstancenorm |
tf.raw_ops.QuantizedMatMul Perform a quantized matrix multiplication of a by the matrix b. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedMatMul
tf.raw_ops.QuantizedMatMul(
a, b, min_a, max_a, min_b, max_b, Toutput=tf.dtypes.qint32, transpose_a=False,
transpose_b=False, Tactivation=tf.dtypes.quint8, name=None
)
The inputs must be two-dimensional matrices and the inner dimension of a (after being transposed if transpose_a is non-zero) must match the outer dimension of b (after being transposed if transposed_b is non-zero).
Args
a A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. Must be a two-dimensional tensor.
b A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. Must be a two-dimensional tensor.
min_a A Tensor of type float32. The float value that the lowest quantized a value represents.
max_a A Tensor of type float32. The float value that the highest quantized a value represents.
min_b A Tensor of type float32. The float value that the lowest quantized b value represents.
max_b A Tensor of type float32. The float value that the highest quantized b value represents.
Toutput An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32.
transpose_a An optional bool. Defaults to False. If true, a is transposed before multiplication.
transpose_b An optional bool. Defaults to False. If true, b is transposed before multiplication.
Tactivation An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8. The type of output produced by activation function following this operation.
name A name for the operation (optional).
Returns A tuple of Tensor objects (out, min_out, max_out). out A Tensor of type Toutput.
min_out A Tensor of type float32.
max_out A Tensor of type float32. | tensorflow.raw_ops.quantizedmatmul |
tf.raw_ops.QuantizedMatMulWithBias Performs a quantized matrix multiplication of a by the matrix b with bias View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedMatMulWithBias
tf.raw_ops.QuantizedMatMulWithBias(
a, b, bias, min_a, max_a, min_b, max_b, Toutput=tf.dtypes.qint32,
transpose_a=False, transpose_b=False, input_quant_mode='MIN_FIRST',
name=None
)
add. The inputs must be two-dimensional matrices and 1D bias vector. And the inner dimension of a (after being transposed if transpose_a is non-zero) must match the outer dimension of b (after being transposed if transposed_b is non-zero). Then do broadcast add operation with bias values on the matrix multiplication result. The bias size must match inner dimension of b. Args: a: A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. A matrix to be multiplied. Must be a two-dimensional tensor of type quint8. b: A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. A matrix to be multiplied and must be a two-dimensional tensor of type qint8. bias: A Tensor. Must be one of the following types: float32, qint32. A 1D bias tensor with size matching inner dimension of b (after being transposed if transposed_b is non-zero). min_a: A Tensor of type float32. The float value that the lowest quantized a value represents. max_a: A Tensor of type float32. The float value that the highest quantized a value represents. min_b: A Tensor of type float32. The float value that the lowest quantized b value represents. max_b: A Tensor of type float32. The float value that the highest quantized b value represents. Toutput: An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32. transpose_a: An optional bool. Defaults to False. If true, a is transposed before multiplication. transpose_b: An optional bool. Defaults to False. If true, b is transposed before multiplication. input_quant_mode: An optional string from: "MIN_FIRST", "SCALED". Defaults to "MIN_FIRST". Input data quantization mode. Either MIN_FIRST(default) or SCALED. name: A name for the operation (optional). Returns: A tuple of Tensor objects (out, min_out, max_out). out: A `Tensor` of type `Toutput`.
min_out: A `Tensor` of type `float32`.
max_out: A `Tensor` of type `float32`. | tensorflow.raw_ops.quantizedmatmulwithbias |
tf.raw_ops.QuantizedMatMulWithBiasAndDequantize View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedMatMulWithBiasAndDequantize
tf.raw_ops.QuantizedMatMulWithBiasAndDequantize(
a, b, bias, min_a, max_a, min_b, max_b, min_freezed_output, max_freezed_output,
Toutput, transpose_a=False, transpose_b=False,
input_quant_mode='MIN_FIRST', name=None
)
Args
a A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
b A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor. Must be one of the following types: float32, qint32.
min_a A Tensor of type float32.
max_a A Tensor of type float32.
min_b A Tensor of type float32.
max_b A Tensor of type float32.
min_freezed_output A Tensor of type float32.
max_freezed_output A Tensor of type float32.
Toutput A tf.DType from: tf.float32.
transpose_a An optional bool. Defaults to False.
transpose_b An optional bool. Defaults to False.
input_quant_mode An optional string from: "MIN_FIRST", "SCALED". Defaults to "MIN_FIRST".
name A name for the operation (optional).
Returns A Tensor of type Toutput. | tensorflow.raw_ops.quantizedmatmulwithbiasanddequantize |
tf.raw_ops.QuantizedMatMulWithBiasAndRelu Perform a quantized matrix multiplication of a by the matrix b with bias View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedMatMulWithBiasAndRelu
tf.raw_ops.QuantizedMatMulWithBiasAndRelu(
a, b, bias, min_a, max_a, min_b, max_b, Toutput=tf.dtypes.qint32,
transpose_a=False, transpose_b=False, input_quant_mode='MIN_FIRST',
name=None
)
add and relu fusion. The inputs must be two-dimensional matrices and 1D bias vector. And the inner dimension of a (after being transposed if transpose_a is non-zero) must match the outer dimension of b (after being transposed if transposed_b is non-zero). Then do broadcast add operation with bias values on the matrix multiplication result. The bias size must match inner dimension of b. Then do relu activation to get non-negative result. Args: a: A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. A matrix to be multiplied. Must be a two-dimensional tensor of type quint8. b: A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. A matrix to be multiplied and must be a two-dimensional tensor of type qint8. bias: A Tensor of type float32. A 1D bias tensor with size matching with inner dimension of b (after being transposed if transposed_b is non-zero). min_a: A Tensor of type float32. The float value that the lowest quantized a value represents. max_a: A Tensor of type float32. The float value that the highest quantized a value represents. min_b: A Tensor of type float32. The float value that the lowest quantized b value represents. max_b: A Tensor of type float32. The float value that the highest quantized b value represents. Toutput: An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32. transpose_a: An optional bool. Defaults to False. If true, a is transposed before multiplication. transpose_b: An optional bool. Defaults to False. If true, b is transposed before multiplication. input_quant_mode: An optional string from: "MIN_FIRST", "SCALED". Defaults to "MIN_FIRST". Input data quantization mode. Either MIN_FIRST(default) or SCALED. name: A name for the operation (optional). Returns: A tuple of Tensor objects (out, min_out, max_out). out: A `Tensor` of type `Toutput`.
min_out: A `Tensor` of type `float32`.
max_out: A `Tensor` of type `float32`. | tensorflow.raw_ops.quantizedmatmulwithbiasandrelu |
tf.raw_ops.QuantizedMatMulWithBiasAndReluAndRequantize Perform a quantized matrix multiplication of a by the matrix b with bias View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedMatMulWithBiasAndReluAndRequantize
tf.raw_ops.QuantizedMatMulWithBiasAndReluAndRequantize(
a, b, bias, min_a, max_a, min_b, max_b, min_freezed_output, max_freezed_output,
Toutput=tf.dtypes.quint8, transpose_a=False, transpose_b=False,
input_quant_mode='MIN_FIRST', name=None
)
add and relu and requantize fusion. The inputs must be two-dimensional matrices and 1D bias vector. And the inner dimension of a (after being transposed if transpose_a is non-zero) must match the outer dimension of b (after being transposed if transposed_b is non-zero). Then do broadcast add operation with bias values on the matrix multiplication result. The bias size must match inner dimension of b. Then do relu activation to get non-negative result. Then do requantize operation to get final uint8 result. Args: a: A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. A matrix to be multiplied. Must be a two-dimensional tensor of type quint8. b: A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. A matrix to be multiplied and must be a two-dimensional tensor of type qint8. bias: A Tensor. Must be one of the following types: float32, qint32. A 1D bias tensor with size matching with inner dimension of b (after being transposed if transposed_b is non-zero). min_a: A Tensor of type float32. The float value that the lowest quantized a value represents. max_a: A Tensor of type float32. The float value that the highest quantized a value represents. min_b: A Tensor of type float32. The float value that the lowest quantized b value represents. max_b: A Tensor of type float32. The float value that the highest quantized b value represents. min_freezed_output: A Tensor of type float32. The float value that the highest quantized output value after requantize. max_freezed_output: A Tensor of type float32. Toutput: An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8. transpose_a: An optional bool. Defaults to False. If true, a is transposed before multiplication. transpose_b: An optional bool. Defaults to False. If true, b is transposed before multiplication. input_quant_mode: An optional string from: "MIN_FIRST", "SCALED". Defaults to "MIN_FIRST". Input data quantization mode. Either MIN_FIRST(default) or SCALED. name: A name for the operation (optional). Returns: A tuple of Tensor objects (out, min_out, max_out). out: A `Tensor` of type `Toutput`.
min_out: A `Tensor` of type `float32`.
max_out: A `Tensor` of type `float32`. | tensorflow.raw_ops.quantizedmatmulwithbiasandreluandrequantize |
tf.raw_ops.QuantizedMatMulWithBiasAndRequantize View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedMatMulWithBiasAndRequantize
tf.raw_ops.QuantizedMatMulWithBiasAndRequantize(
a, b, bias, min_a, max_a, min_b, max_b, min_freezed_output, max_freezed_output,
Toutput=tf.dtypes.quint8, transpose_a=False, transpose_b=False,
input_quant_mode='MIN_FIRST', name=None
)
Args
a A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
b A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
bias A Tensor. Must be one of the following types: float32, qint32.
min_a A Tensor of type float32.
max_a A Tensor of type float32.
min_b A Tensor of type float32.
max_b A Tensor of type float32.
min_freezed_output A Tensor of type float32.
max_freezed_output A Tensor of type float32.
Toutput An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8.
transpose_a An optional bool. Defaults to False.
transpose_b An optional bool. Defaults to False.
input_quant_mode An optional string from: "MIN_FIRST", "SCALED". Defaults to "MIN_FIRST".
name A name for the operation (optional).
Returns A tuple of Tensor objects (out, min_out, max_out). out A Tensor of type Toutput.
min_out A Tensor of type float32.
max_out A Tensor of type float32. | tensorflow.raw_ops.quantizedmatmulwithbiasandrequantize |
tf.raw_ops.QuantizedMaxPool Produces the max pool of the input tensor for quantized types. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedMaxPool
tf.raw_ops.QuantizedMaxPool(
input, min_input, max_input, ksize, strides, padding, name=None
)
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16. The 4D (batch x rows x cols x depth) Tensor to MaxReduce over.
min_input A Tensor of type float32. The float value that the lowest quantized input value represents.
max_input A Tensor of type float32. The float value that the highest quantized input value represents.
ksize A list of ints. The size of the window for each dimension of the input tensor. The length must be 4 to match the number of dimensions of the input.
strides A list of ints. The stride of the sliding window for each dimension of the input tensor. The length must be 4 to match the number of dimensions of the input.
padding A string from: "SAME", "VALID". The type of padding algorithm to use.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, min_output, max_output). output A Tensor. Has the same type as input.
min_output A Tensor of type float32.
max_output A Tensor of type float32. | tensorflow.raw_ops.quantizedmaxpool |
tf.raw_ops.QuantizedMul Returns x * y element-wise, working on quantized buffers. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedMul
tf.raw_ops.QuantizedMul(
x, y, min_x, max_x, min_y, max_y, Toutput=tf.dtypes.qint32, name=None
)
Args
x A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
y A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
min_x A Tensor of type float32. The float value that the lowest quantized x value represents.
max_x A Tensor of type float32. The float value that the highest quantized x value represents.
min_y A Tensor of type float32. The float value that the lowest quantized y value represents.
max_y A Tensor of type float32. The float value that the highest quantized y value represents.
Toutput An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.qint32.
name A name for the operation (optional).
Returns A tuple of Tensor objects (z, min_z, max_z). z A Tensor of type Toutput.
min_z A Tensor of type float32.
max_z A Tensor of type float32. | tensorflow.raw_ops.quantizedmul |
tf.raw_ops.QuantizeDownAndShrinkRange Convert the quantized 'input' tensor into a lower-precision 'output', using the View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizeDownAndShrinkRange
tf.raw_ops.QuantizeDownAndShrinkRange(
input, input_min, input_max, out_type, name=None
)
actual distribution of the values to maximize the usage of the lower bit depth and adjusting the output min and max ranges accordingly. [input_min, input_max] are scalar floats that specify the range for the float interpretation of the 'input' data. For example, if input_min is -1.0f and input_max is 1.0f, and we are dealing with quint16 quantized data, then a 0 value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f. This operator tries to squeeze as much precision as possible into an output with a lower bit depth by calculating the actual min and max values found in the data. For example, maybe that quint16 input has no values lower than 16,384 and none higher than 49,152. That means only half the range is actually needed, all the float interpretations are between -0.5f and 0.5f, so if we want to compress the data into a quint8 output, we can use that range rather than the theoretical -1.0f to 1.0f that is suggested by the input min and max. In practice, this is most useful for taking output from operations like QuantizedMatMul that can produce higher bit-depth outputs than their inputs and may have large potential output ranges, but in practice have a distribution of input values that only uses a small fraction of the possible range. By feeding that output into this operator, we can reduce it from 32 bits down to 8 with minimal loss of accuracy.
Args
input A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
input_min A Tensor of type float32. The float value that the minimum quantized input value represents.
input_max A Tensor of type float32. The float value that the maximum quantized input value represents.
out_type A tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. The type of the output. Should be a lower bit depth than Tinput.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, output_min, output_max). output A Tensor of type out_type.
output_min A Tensor of type float32.
output_max A Tensor of type float32. | tensorflow.raw_ops.quantizedownandshrinkrange |
tf.raw_ops.QuantizedRelu Computes Quantized Rectified Linear: max(features, 0) View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedRelu
tf.raw_ops.QuantizedRelu(
features, min_features, max_features, out_type=tf.dtypes.quint8, name=None
)
Args
features A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
min_features A Tensor of type float32. The float value that the lowest quantized value represents.
max_features A Tensor of type float32. The float value that the highest quantized value represents.
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8.
name A name for the operation (optional).
Returns A tuple of Tensor objects (activations, min_activations, max_activations). activations A Tensor of type out_type.
min_activations A Tensor of type float32.
max_activations A Tensor of type float32. | tensorflow.raw_ops.quantizedrelu |
tf.raw_ops.QuantizedRelu6 Computes Quantized Rectified Linear 6: min(max(features, 0), 6) View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedRelu6
tf.raw_ops.QuantizedRelu6(
features, min_features, max_features, out_type=tf.dtypes.quint8, name=None
)
Args
features A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
min_features A Tensor of type float32. The float value that the lowest quantized value represents.
max_features A Tensor of type float32. The float value that the highest quantized value represents.
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8.
name A name for the operation (optional).
Returns A tuple of Tensor objects (activations, min_activations, max_activations). activations A Tensor of type out_type.
min_activations A Tensor of type float32.
max_activations A Tensor of type float32. | tensorflow.raw_ops.quantizedrelu6 |
tf.raw_ops.QuantizedReluX Computes Quantized Rectified Linear X: min(max(features, 0), max_value) View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedReluX
tf.raw_ops.QuantizedReluX(
features, max_value, min_features, max_features, out_type=tf.dtypes.quint8,
name=None
)
Args
features A Tensor. Must be one of the following types: qint8, quint8, qint32, qint16, quint16.
max_value A Tensor of type float32.
min_features A Tensor of type float32. The float value that the lowest quantized value represents.
max_features A Tensor of type float32. The float value that the highest quantized value represents.
out_type An optional tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16. Defaults to tf.quint8.
name A name for the operation (optional).
Returns A tuple of Tensor objects (activations, min_activations, max_activations). activations A Tensor of type out_type.
min_activations A Tensor of type float32.
max_activations A Tensor of type float32. | tensorflow.raw_ops.quantizedrelux |
tf.raw_ops.QuantizedReshape Reshapes a quantized tensor as per the Reshape op. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedReshape
tf.raw_ops.QuantizedReshape(
tensor, shape, input_min, input_max, name=None
)
<!-- Tabular view -->
<table class="responsive fixed orange">
<colgroup><col width="214px"><col></colgroup>
<tr><th colspan="2"><h2 class="add-link">Args</h2></th></tr>
<tr>
<td>
`tensor`
</td>
<td>
A `Tensor`.
</td>
</tr><tr>
<td>
`shape`
</td>
<td>
A `Tensor`. Must be one of the following types: `int32`, `int64`.
Defines the shape of the output tensor.
</td>
</tr><tr>
<td>
`input_min`
</td>
<td>
A `Tensor` of type `float32`. The minimum value of the input.
</td>
</tr><tr>
<td>
`input_max`
</td>
<td>
A `Tensor` of type `float32`. The maximum value of the input.
</td>
</tr><tr>
<td>
`name`
</td>
<td>
A name for the operation (optional).
</td>
</tr>
</table>
<!-- Tabular view -->
<table class="responsive fixed orange">
<colgroup><col width="214px"><col></colgroup>
<tr><th colspan="2"><h2 class="add-link">Returns</h2></th></tr>
<tr class="alt">
<td colspan="2">
A tuple of `Tensor` objects (output, output_min, output_max).
</td>
</tr>
<tr>
<td>
`output`
</td>
<td>
A `Tensor`. Has the same type as `tensor`.
</td>
</tr><tr>
<td>
`output_min`
</td>
<td>
A `Tensor` of type `float32`.
</td>
</tr><tr>
<td>
`output_max`
</td>
<td>
A `Tensor` of type `float32`.
</td>
</tr>
</table> | tensorflow.raw_ops.quantizedreshape |
tf.raw_ops.QuantizedResizeBilinear Resize quantized images to size using quantized bilinear interpolation. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizedResizeBilinear
tf.raw_ops.QuantizedResizeBilinear(
images, size, min, max, align_corners=False, half_pixel_centers=False, name=None
)
Input images and output images must be quantized types.
Args
images A Tensor. Must be one of the following types: quint8, qint32, float32. 4-D with shape [batch, height, width, channels].
size A 1-D int32 Tensor of 2 elements: new_height, new_width. The new size for the images.
min A Tensor of type float32.
max A Tensor of type float32.
align_corners An optional bool. Defaults to False. If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false.
half_pixel_centers An optional bool. Defaults to False.
name A name for the operation (optional).
Returns A tuple of Tensor objects (resized_images, out_min, out_max). resized_images A Tensor. Has the same type as images.
out_min A Tensor of type float32.
out_max A Tensor of type float32. | tensorflow.raw_ops.quantizedresizebilinear |
tf.raw_ops.QuantizeV2 Quantize the 'input' tensor of type float to 'output' tensor of type 'T'. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QuantizeV2
tf.raw_ops.QuantizeV2(
input, min_range, max_range, T, mode='MIN_COMBINED',
round_mode='HALF_AWAY_FROM_ZERO', narrow_range=False, axis=-1,
ensure_minimum_range=0.01, name=None
)
[min_range, max_range] are scalar floats that specify the range for the 'input' data. The 'mode' attribute controls exactly which calculations are used to convert the float values to their quantized equivalents. The 'round_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents. In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: out[i] = (in[i] - min_range) * range(T) / (max_range - min_range)
if T == qint8: out[i] -= (range(T) + 1) / 2.0
here range(T) = numeric_limits<T>::max() - numeric_limits<T>::min() MIN_COMBINED Mode Example Assume the input is type float and has a possible range of [0.0, 6.0] and the output type is quint8 ([0, 255]). The min_range and max_range values should be specified as 0.0 and 6.0. Quantizing from float to quint8 will multiply each value of the input by 255/6 and cast to quint8. If the output type was qint8 ([-128, 127]), the operation will additionally subtract each value by 128 prior to casting, so that the range of values aligns with the range of qint8. If the mode is 'MIN_FIRST', then this approach is used: num_discrete_values = 1 << (# of bits in T)
range_adjust = num_discrete_values / (num_discrete_values - 1)
range = (range_max - range_min) * range_adjust
range_scale = num_discrete_values / range
quantized = round(input * range_scale) - round(range_min * range_scale) +
numeric_limits<T>::min()
quantized = max(quantized, numeric_limits<T>::min())
quantized = min(quantized, numeric_limits<T>::max())
The biggest difference between this and MIN_COMBINED is that the minimum range is rounded first, before it's subtracted from the rounded value. With MIN_COMBINED, a small bias is introduced where repeated iterations of quantizing and dequantizing will introduce a larger and larger error. SCALED mode Example SCALED mode matches the quantization approach used in QuantizeAndDequantize{V2|V3}. If the mode is SCALED, the quantization is performed by multiplying each input value by a scaling_factor. The scaling_factor is determined from min_range and max_range to be as large as possible such that the range from min_range to max_range is representable within values of type T.
const int min_T = std::numeric_limits<T>::min();
const int max_T = std::numeric_limits<T>::max();
const float max_float = std::numeric_limits<float>::max();
const float scale_factor_from_min_side =
(min_T * min_range > 0) ? min_T / min_range : max_float;
const float scale_factor_from_max_side =
(max_T * max_range > 0) ? max_T / max_range : max_float;
const float scale_factor = std::min(scale_factor_from_min_side,
scale_factor_from_max_side);
We next use the scale_factor to adjust min_range and max_range as follows: min_range = min_T / scale_factor;
max_range = max_T / scale_factor;
e.g. if T = qint8, and initially min_range = -10, and max_range = 9, we would compare -128/-10.0 = 12.8 to 127/9.0 = 14.11, and set scaling_factor = 12.8 In this case, min_range would remain -10, but max_range would be adjusted to 127 / 12.8 = 9.921875 So we will quantize input values in the range (-10, 9.921875) to (-128, 127). The input tensor can now be quantized by clipping values to the range min_range to max_range, then multiplying by scale_factor as follows: result = round(min(max_range, max(min_range, input)) * scale_factor)
The adjusted min_range and max_range are returned as outputs 2 and 3 of this operation. These outputs should be used as the range for any further calculations. narrow_range (bool) attribute If true, we do not use the minimum quantized value. i.e. for int8 the quantized output, it would be restricted to the range -127..127 instead of the full -128..127 range. This is provided for compatibility with certain inference backends. (Only applies to SCALED mode) axis (int) attribute An optional axis attribute can specify a dimension index of the input tensor, such that quantization ranges will be calculated and applied separately for each slice of the tensor along that dimension. This is useful for per-channel quantization. If axis is specified, min_range and max_range if axis=None, per-tensor quantization is performed as normal. ensure_minimum_range (float) attribute Ensures the minimum quantization range is at least this value. The legacy default value for this is 0.01, but it is strongly suggested to set it to 0 for new uses.
Args
input A Tensor of type float32.
min_range A Tensor of type float32. The minimum value of the quantization range. This value may be adjusted by the op depending on other parameters. The adjusted value is written to output_min. If the axis attribute is specified, this must be a 1-D tensor whose size matches the axis dimension of the input and output tensors.
max_range A Tensor of type float32. The maximum value of the quantization range. This value may be adjusted by the op depending on other parameters. The adjusted value is written to output_max. If the axis attribute is specified, this must be a 1-D tensor whose size matches the axis dimension of the input and output tensors.
T A tf.DType from: tf.qint8, tf.quint8, tf.qint32, tf.qint16, tf.quint16.
mode An optional string from: "MIN_COMBINED", "MIN_FIRST", "SCALED". Defaults to "MIN_COMBINED".
round_mode An optional string from: "HALF_AWAY_FROM_ZERO", "HALF_TO_EVEN". Defaults to "HALF_AWAY_FROM_ZERO".
narrow_range An optional bool. Defaults to False.
axis An optional int. Defaults to -1.
ensure_minimum_range An optional float. Defaults to 0.01.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, output_min, output_max). output A Tensor of type T.
output_min A Tensor of type float32.
output_max A Tensor of type float32. | tensorflow.raw_ops.quantizev2 |
tf.raw_ops.QueueClose Closes the given queue. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QueueClose
tf.raw_ops.QueueClose(
handle, cancel_pending_enqueues=False, name=None
)
This operation signals that no more elements will be enqueued in the given queue. Subsequent Enqueue(Many) operations will fail. Subsequent Dequeue(Many) operations will continue to succeed if sufficient elements remain in the queue. Subsequent Dequeue(Many) operations that would block will fail immediately.
Args
handle A Tensor of type mutable string. The handle to a queue.
cancel_pending_enqueues An optional bool. Defaults to False. If true, all pending enqueue requests that are blocked on the given queue will be canceled.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.queueclose |
tf.raw_ops.QueueCloseV2 Closes the given queue. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QueueCloseV2
tf.raw_ops.QueueCloseV2(
handle, cancel_pending_enqueues=False, name=None
)
This operation signals that no more elements will be enqueued in the given queue. Subsequent Enqueue(Many) operations will fail. Subsequent Dequeue(Many) operations will continue to succeed if sufficient elements remain in the queue. Subsequent Dequeue(Many) operations that would block will fail immediately.
Args
handle A Tensor of type resource. The handle to a queue.
cancel_pending_enqueues An optional bool. Defaults to False. If true, all pending enqueue requests that are blocked on the given queue will be canceled.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.queueclosev2 |
tf.raw_ops.QueueDequeue Dequeues a tuple of one or more tensors from the given queue. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QueueDequeue
tf.raw_ops.QueueDequeue(
handle, component_types, timeout_ms=-1, name=None
)
This operation has k outputs, where k is the number of components in the tuples stored in the given queue, and output i is the ith component of the dequeued tuple. N.B. If the queue is empty, this operation will block until an element has been dequeued (or 'timeout_ms' elapses, if specified).
Args
handle A Tensor of type mutable string. The handle to a queue.
component_types A list of tf.DTypes that has length >= 1. The type of each component in a tuple.
timeout_ms An optional int. Defaults to -1. If the queue is empty, this operation will block for up to timeout_ms milliseconds. Note: This option is not supported yet.
name A name for the operation (optional).
Returns A list of Tensor objects of type component_types. | tensorflow.raw_ops.queuedequeue |
tf.raw_ops.QueueDequeueMany Dequeues n tuples of one or more tensors from the given queue. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QueueDequeueMany
tf.raw_ops.QueueDequeueMany(
handle, n, component_types, timeout_ms=-1, name=None
)
If the queue is closed and there are fewer than n elements, then an OutOfRange error is returned. This operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. All of the components in the dequeued tuple will have size n in the 0th dimension. This operation has k outputs, where k is the number of components in the tuples stored in the given queue, and output i is the ith component of the dequeued tuple. N.B. If the queue is empty, this operation will block until n elements have been dequeued (or 'timeout_ms' elapses, if specified).
Args
handle A Tensor of type mutable string. The handle to a queue.
n A Tensor of type int32. The number of tuples to dequeue.
component_types A list of tf.DTypes that has length >= 1. The type of each component in a tuple.
timeout_ms An optional int. Defaults to -1. If the queue has fewer than n elements, this operation will block for up to timeout_ms milliseconds. Note: This option is not supported yet.
name A name for the operation (optional).
Returns A list of Tensor objects of type component_types. | tensorflow.raw_ops.queuedequeuemany |
tf.raw_ops.QueueDequeueManyV2 Dequeues n tuples of one or more tensors from the given queue. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QueueDequeueManyV2
tf.raw_ops.QueueDequeueManyV2(
handle, n, component_types, timeout_ms=-1, name=None
)
If the queue is closed and there are fewer than n elements, then an OutOfRange error is returned. This operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. All of the components in the dequeued tuple will have size n in the 0th dimension. This operation has k outputs, where k is the number of components in the tuples stored in the given queue, and output i is the ith component of the dequeued tuple. N.B. If the queue is empty, this operation will block until n elements have been dequeued (or 'timeout_ms' elapses, if specified).
Args
handle A Tensor of type resource. The handle to a queue.
n A Tensor of type int32. The number of tuples to dequeue.
component_types A list of tf.DTypes that has length >= 1. The type of each component in a tuple.
timeout_ms An optional int. Defaults to -1. If the queue has fewer than n elements, this operation will block for up to timeout_ms milliseconds. Note: This option is not supported yet.
name A name for the operation (optional).
Returns A list of Tensor objects of type component_types. | tensorflow.raw_ops.queuedequeuemanyv2 |
tf.raw_ops.QueueDequeueUpTo Dequeues n tuples of one or more tensors from the given queue. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QueueDequeueUpTo
tf.raw_ops.QueueDequeueUpTo(
handle, n, component_types, timeout_ms=-1, name=None
)
This operation is not supported by all queues. If a queue does not support DequeueUpTo, then an Unimplemented error is returned. If the queue is closed and there are more than 0 but less than n elements remaining, then instead of returning an OutOfRange error like QueueDequeueMany, less than n elements are returned immediately. If the queue is closed and there are 0 elements left in the queue, then an OutOfRange error is returned just like in QueueDequeueMany. Otherwise the behavior is identical to QueueDequeueMany: This operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. All of the components in the dequeued tuple will have size n in the 0th dimension. This operation has k outputs, where k is the number of components in the tuples stored in the given queue, and output i is the ith component of the dequeued tuple.
Args
handle A Tensor of type mutable string. The handle to a queue.
n A Tensor of type int32. The number of tuples to dequeue.
component_types A list of tf.DTypes that has length >= 1. The type of each component in a tuple.
timeout_ms An optional int. Defaults to -1. If the queue has fewer than n elements, this operation will block for up to timeout_ms milliseconds. Note: This option is not supported yet.
name A name for the operation (optional).
Returns A list of Tensor objects of type component_types. | tensorflow.raw_ops.queuedequeueupto |
tf.raw_ops.QueueDequeueUpToV2 Dequeues n tuples of one or more tensors from the given queue. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.QueueDequeueUpToV2
tf.raw_ops.QueueDequeueUpToV2(
handle, n, component_types, timeout_ms=-1, name=None
)
This operation is not supported by all queues. If a queue does not support DequeueUpTo, then an Unimplemented error is returned. If the queue is closed and there are more than 0 but less than n elements remaining, then instead of returning an OutOfRange error like QueueDequeueMany, less than n elements are returned immediately. If the queue is closed and there are 0 elements left in the queue, then an OutOfRange error is returned just like in QueueDequeueMany. Otherwise the behavior is identical to QueueDequeueMany: This operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. All of the components in the dequeued tuple will have size n in the 0th dimension. This operation has k outputs, where k is the number of components in the tuples stored in the given queue, and output i is the ith component of the dequeued tuple.
Args
handle A Tensor of type resource. The handle to a queue.
n A Tensor of type int32. The number of tuples to dequeue.
component_types A list of tf.DTypes that has length >= 1. The type of each component in a tuple.
timeout_ms An optional int. Defaults to -1. If the queue has fewer than n elements, this operation will block for up to timeout_ms milliseconds. Note: This option is not supported yet.
name A name for the operation (optional).
Returns A list of Tensor objects of type component_types. | tensorflow.raw_ops.queuedequeueuptov2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.