doc_content
stringlengths 1
386k
| doc_id
stringlengths 5
188
|
---|---|
tf.raw_ops.Sum Computes the sum of elements across dimensions of a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Sum
tf.raw_ops.Sum(
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.sum |
tf.raw_ops.SummaryWriter View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.SummaryWriter
tf.raw_ops.SummaryWriter(
shared_name='', container='', name=None
)
Args
shared_name An optional string. Defaults to "".
container An optional string. Defaults to "".
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.summarywriter |
tf.raw_ops.Svd Computes the singular value decompositions of one or more matrices. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Svd
tf.raw_ops.Svd(
input, compute_uv=True, full_matrices=False, name=None
)
Computes the SVD of each inner matrix in input such that input[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :, :]) # a is a tensor containing a batch of matrices.
# s is a tensor of singular values for each matrix.
# u is the tensor containing the left singular vectors for each matrix.
# v is the tensor containing the right singular vectors for each matrix.
s, u, v = svd(a)
s, _, _ = svd(a, compute_uv=False)
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.
compute_uv An optional bool. Defaults to True. If true, left and right singular vectors will be computed and returned in u and v, respectively. If false, u and v are not set and should never referenced.
full_matrices An optional bool. Defaults to False. If true, compute full-sized u and v. If false (the default), compute only the leading P singular vectors. Ignored if compute_uv is False.
name A name for the operation (optional).
Returns A tuple of Tensor objects (s, u, v). s A Tensor. Has the same type as input.
u A Tensor. Has the same type as input.
v A Tensor. Has the same type as input. | tensorflow.raw_ops.svd |
tf.raw_ops.Switch Forwards data to the output port determined by pred. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Switch
tf.raw_ops.Switch(
data, pred, name=None
)
If pred is true, the data input is forwarded to output_true. Otherwise, the data goes to output_false. See also RefSwitch and Merge.
Args
data A Tensor. The tensor to be forwarded to the appropriate output.
pred A Tensor of type bool. A scalar that specifies which output port will receive data.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output_false, output_true). output_false A Tensor. Has the same type as data.
output_true A Tensor. Has the same type as data. | tensorflow.raw_ops.switch |
tf.raw_ops.SymbolicGradient Computes the gradient function for function f via backpropagation. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.SymbolicGradient
tf.raw_ops.SymbolicGradient(
input, Tout, f, name=None
)
Args
input A list of Tensor objects. a list of input tensors of size N + M;
Tout A list of tf.DTypes that has length >= 1. the type list for the input list.
f A function decorated with @Defun. The function we want to compute the gradient for. The function 'f' must be a numerical function which takes N inputs and produces M outputs. Its gradient function 'g', which is computed by this SymbolicGradient op is a function taking N + M inputs and produces N outputs. I.e. if we have (y1, y2, ..., y_M) = f(x1, x2, ..., x_N), then, g is (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N, dL/dy1, dL/dy2, ..., dL/dy_M), where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the loss function). dL/dx_i is the partial derivative of L with respect to x_i. (Needs some math expert to say the comment above better.)
name A name for the operation (optional).
Returns A list of Tensor objects of type Tout. | tensorflow.raw_ops.symbolicgradient |
tf.raw_ops.TakeDataset Creates a dataset that contains count elements from the input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TakeDataset
tf.raw_ops.TakeDataset(
input_dataset, count, output_types, output_shapes, name=None
)
Args
input_dataset A Tensor of type variant.
count A Tensor of type int64. A scalar representing the number of elements from the input_dataset that should be taken. A value of -1 indicates that all of input_dataset is taken.
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.takedataset |
tf.raw_ops.TakeManySparseFromTensorsMap Read SparseTensors from a SparseTensorsMap and concatenate them. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TakeManySparseFromTensorsMap
tf.raw_ops.TakeManySparseFromTensorsMap(
sparse_handles, dtype, container='', shared_name='',
name=None
)
The input sparse_handles must be an int64 matrix of shape [N, 1] where N is the minibatch size and the rows correspond to the output handles of AddSparseToTensorsMap or AddManySparseToTensorsMap. The ranks of the original SparseTensor objects that went into the given input ops must all match. When the final SparseTensor is created, it has rank one higher than the ranks of the incoming SparseTensor objects (they have been concatenated along a new row dimension on the left). The output SparseTensor object's shape values for all dimensions but the first are the max across the input SparseTensor objects' shape values for the corresponding dimensions. Its first shape value is N, the minibatch size. The input SparseTensor objects' indices are assumed ordered in standard lexicographic order. If this is not the case, after this step run SparseReorder to restore index ordering. For example, if the handles represent an input, which is a [2, 3] matrix representing two original SparseTensor objects: index = [ 0]
[10]
[20]
values = [1, 2, 3]
shape = [50]
and index = [ 2]
[10]
values = [4, 5]
shape = [30]
then the final SparseTensor will be: index = [0 0]
[0 10]
[0 20]
[1 2]
[1 10]
values = [1, 2, 3, 4, 5]
shape = [2 50]
Args
sparse_handles A Tensor of type int64. 1-D, The N serialized SparseTensor objects. Shape: [N].
dtype A tf.DType. The dtype of the SparseTensor objects stored in the SparseTensorsMap.
container An optional string. Defaults to "". The container name for the SparseTensorsMap read by this op.
shared_name An optional string. Defaults to "". The shared name for the SparseTensorsMap read by this op. It should not be blank; rather the shared_name or unique Operation name of the Op that created the original SparseTensorsMap should be used.
name A name for the operation (optional).
Returns A tuple of Tensor objects (sparse_indices, sparse_values, sparse_shape). sparse_indices A Tensor of type int64.
sparse_values A Tensor of type dtype.
sparse_shape A Tensor of type int64. | tensorflow.raw_ops.takemanysparsefromtensorsmap |
tf.raw_ops.TakeWhileDataset Creates a dataset that stops iteration when predicate` is false. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TakeWhileDataset
tf.raw_ops.TakeWhileDataset(
input_dataset, other_arguments, predicate, output_types, output_shapes,
name=None
)
The predicate function must return a scalar boolean and accept the following arguments: One tensor for each component of an element of input_dataset. One tensor for each value in other_arguments.
Args
input_dataset A Tensor of type variant.
other_arguments A list of Tensor objects. A list of tensors, typically values that were captured when building a closure for predicate.
predicate A function decorated with @Defun. A function returning a scalar boolean.
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.takewhiledataset |
tf.raw_ops.Tan Computes tan of x element-wise. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Tan
tf.raw_ops.Tan(
x, name=None
)
Given an input tensor, this function computes tangent of every element in the tensor. Input range is (-inf, inf) and output range is (-inf, inf). If input lies outside the boundary, nan is returned. x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 200, 10000, float("inf")])
tf.math.tan(x) ==> [nan 0.45231566 -0.5463025 1.5574077 2.572152 -1.7925274 0.32097113 nan]
Args
x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, int8, int16, int32, int64, complex64, complex128.
name A name for the operation (optional).
Returns A Tensor. Has the same type as x. | tensorflow.raw_ops.tan |
tf.raw_ops.Tanh Computes hyperbolic tangent of x element-wise. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Tanh
tf.raw_ops.Tanh(
x, name=None
)
Given an input tensor, this function computes hyperbolic tangent of every element in the tensor. Input range is [-inf, inf] and output range is [-1,1].
x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")])
tf.math.tanh(x)
<tf.Tensor: shape=(8,), dtype=float32, numpy=
array([-1. , -0.99990916, -0.46211717, 0.7615942 , 0.8336547 ,
0.9640276 , 0.9950547 , 1. ], dtype=float32)>
Args
x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, complex64, complex128.
name A name for the operation (optional).
Returns A Tensor. Has the same type as x. | tensorflow.raw_ops.tanh |
tf.raw_ops.TanhGrad Computes the gradient for the tanh of x wrt its input. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TanhGrad
tf.raw_ops.TanhGrad(
y, dy, name=None
)
Specifically, grad = dy * (1 - y*y), where y = tanh(x), and dy is the corresponding input gradient.
Args
y A Tensor. Must be one of the following types: bfloat16, half, float32, float64, complex64, complex128.
dy A Tensor. Must have the same type as y.
name A name for the operation (optional).
Returns A Tensor. Has the same type as y. | tensorflow.raw_ops.tanhgrad |
tf.raw_ops.TemporaryVariable Returns a tensor that may be mutated, but only persists within a single step. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TemporaryVariable
tf.raw_ops.TemporaryVariable(
shape, dtype, var_name='', name=None
)
This is an experimental op for internal use only and it is possible to use this op in unsafe ways. DO NOT USE unless you fully understand the risks. It is the caller's responsibility to ensure that 'ref' is eventually passed to a matching 'DestroyTemporaryVariable' op after all other uses have completed. Outputs a ref to the tensor state so it may be read or modified. E.g. var = state_ops._temporaryvariable([1, 2], types.float) var_name = var.op.name var = state_ops.assign(var, [[4.0, 5.0]]) var = state_ops.assign_add(var, [[6.0, 7.0]]) final = state_ops._destroy_temporary_variable(var, var_name=var_name)
Args
shape A tf.TensorShape or list of ints. The shape of the variable tensor.
dtype A tf.DType. The type of elements in the variable tensor.
var_name An optional string. Defaults to "". Overrides the name used for the temporary variable resource. Default value is the name of the 'TemporaryVariable' op (which is guaranteed unique).
name A name for the operation (optional).
Returns A mutable Tensor of type dtype. | tensorflow.raw_ops.temporaryvariable |
tf.raw_ops.TensorArray View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArray
tf.raw_ops.TensorArray(
size, dtype, dynamic_size=False, clear_after_read=True,
tensor_array_name='', element_shape=None, name=None
)
Args
size A Tensor of type int32.
dtype A tf.DType.
dynamic_size An optional bool. Defaults to False.
clear_after_read An optional bool. Defaults to True.
tensor_array_name An optional string. Defaults to "".
element_shape An optional tf.TensorShape or list of ints. Defaults to None.
name A name for the operation (optional).
Returns A Tensor of type mutable string. | tensorflow.raw_ops.tensorarray |
tf.raw_ops.TensorArrayClose View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayClose
tf.raw_ops.TensorArrayClose(
handle, name=None
)
Args
handle A Tensor of type mutable string.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.tensorarrayclose |
tf.raw_ops.TensorArrayCloseV2 Deprecated. Use TensorArrayCloseV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayCloseV2
tf.raw_ops.TensorArrayCloseV2(
handle, name=None
)
Args
handle A Tensor of type string.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.tensorarrayclosev2 |
tf.raw_ops.TensorArrayCloseV3 Delete the TensorArray from its resource container. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayCloseV3
tf.raw_ops.TensorArrayCloseV3(
handle, name=None
)
This enables the user to close and release the resource in the middle of a step/run.
Args
handle A Tensor of type resource. The handle to a TensorArray (output of TensorArray or TensorArrayGrad).
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.tensorarrayclosev3 |
tf.raw_ops.TensorArrayConcat View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayConcat
tf.raw_ops.TensorArrayConcat(
handle, flow_in, dtype, element_shape_except0=None, name=None
)
Args
handle A Tensor of type mutable string.
flow_in A Tensor of type float32.
dtype A tf.DType.
element_shape_except0 An optional tf.TensorShape or list of ints. Defaults to None.
name A name for the operation (optional).
Returns A tuple of Tensor objects (value, lengths). value A Tensor of type dtype.
lengths A Tensor of type int64. | tensorflow.raw_ops.tensorarrayconcat |
tf.raw_ops.TensorArrayConcatV2 Deprecated. Use TensorArrayConcatV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayConcatV2
tf.raw_ops.TensorArrayConcatV2(
handle, flow_in, dtype, element_shape_except0=None, name=None
)
Args
handle A Tensor of type string.
flow_in A Tensor of type float32.
dtype A tf.DType.
element_shape_except0 An optional tf.TensorShape or list of ints. Defaults to None.
name A name for the operation (optional).
Returns A tuple of Tensor objects (value, lengths). value A Tensor of type dtype.
lengths A Tensor of type int64. | tensorflow.raw_ops.tensorarrayconcatv2 |
tf.raw_ops.TensorArrayConcatV3 Concat the elements from the TensorArray into value value. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayConcatV3
tf.raw_ops.TensorArrayConcatV3(
handle, flow_in, dtype, element_shape_except0=None, name=None
)
Takes T elements of shapes (n0 x d0 x d1 x ...), (n1 x d0 x d1 x ...), ..., (n(T-1) x d0 x d1 x ...)
and concatenates them into a Tensor of shape: (n0 + n1 + ... + n(T-1) x d0 x d1 x ...) All elements must have the same shape (excepting the first dimension).
Args
handle A Tensor of type resource. The handle to a TensorArray.
flow_in A Tensor of type float32. A float scalar that enforces proper chaining of operations.
dtype A tf.DType. The type of the elem that is returned.
element_shape_except0 An optional tf.TensorShape or list of ints. Defaults to None. The expected shape of an element, if known, excluding the first dimension. Used to validate the shapes of TensorArray elements. If this shape is not fully specified, concatenating zero-size TensorArrays is an error.
name A name for the operation (optional).
Returns A tuple of Tensor objects (value, lengths). value A Tensor of type dtype.
lengths A Tensor of type int64. | tensorflow.raw_ops.tensorarrayconcatv3 |
tf.raw_ops.TensorArrayGather View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayGather
tf.raw_ops.TensorArrayGather(
handle, indices, flow_in, dtype, element_shape=None, name=None
)
Args
handle A Tensor of type mutable string.
indices A Tensor of type int32.
flow_in A Tensor of type float32.
dtype A tf.DType.
element_shape An optional tf.TensorShape or list of ints. Defaults to None.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.tensorarraygather |
tf.raw_ops.TensorArrayGatherV2 Deprecated. Use TensorArrayGatherV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayGatherV2
tf.raw_ops.TensorArrayGatherV2(
handle, indices, flow_in, dtype, element_shape=None, name=None
)
Args
handle A Tensor of type string.
indices A Tensor of type int32.
flow_in A Tensor of type float32.
dtype A tf.DType.
element_shape An optional tf.TensorShape or list of ints. Defaults to None.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.tensorarraygatherv2 |
tf.raw_ops.TensorArrayGatherV3 Gather specific elements from the TensorArray into output value. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayGatherV3
tf.raw_ops.TensorArrayGatherV3(
handle, indices, flow_in, dtype, element_shape=None, name=None
)
All elements selected by indices must have the same shape.
Args
handle A Tensor of type resource. The handle to a TensorArray.
indices A Tensor of type int32. The locations in the TensorArray from which to read tensor elements.
flow_in A Tensor of type float32. A float scalar that enforces proper chaining of operations.
dtype A tf.DType. The type of the elem that is returned.
element_shape An optional tf.TensorShape or list of ints. Defaults to None. The expected shape of an element, if known. Used to validate the shapes of TensorArray elements. If this shape is not fully specified, gathering zero-size TensorArrays is an error.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.tensorarraygatherv3 |
tf.raw_ops.TensorArrayGrad View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayGrad
tf.raw_ops.TensorArrayGrad(
handle, flow_in, source, name=None
)
Args
handle A Tensor of type string.
flow_in A Tensor of type float32.
source A string.
name A name for the operation (optional).
Returns A Tensor of type mutable string. | tensorflow.raw_ops.tensorarraygrad |
tf.raw_ops.TensorArrayGradV2 Deprecated. Use TensorArrayGradV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayGradV2
tf.raw_ops.TensorArrayGradV2(
handle, flow_in, source, name=None
)
Args
handle A Tensor of type string.
flow_in A Tensor of type float32.
source A string.
name A name for the operation (optional).
Returns A Tensor of type string. | tensorflow.raw_ops.tensorarraygradv2 |
tf.raw_ops.TensorArrayGradV3 Creates a TensorArray for storing the gradients of values in the given handle. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayGradV3
tf.raw_ops.TensorArrayGradV3(
handle, flow_in, source, name=None
)
If the given TensorArray gradient already exists, returns a reference to it. Locks the size of the original TensorArray by disabling its dynamic size flag. A note about the input flow_in: The handle flow_in forces the execution of the gradient lookup to occur only after certain other operations have occurred. For example, when the forward TensorArray is dynamically sized, writes to this TensorArray may resize the object. The gradient TensorArray is statically sized based on the size of the forward TensorArray when this operation executes. Furthermore, the size of the forward TensorArray is frozen by this call. As a result, the flow is used to ensure that the call to generate the gradient TensorArray only happens after all writes are executed. In the case of dynamically sized TensorArrays, gradient computation should only be performed on read operations that have themselves been chained via flow to occur only after all writes have executed. That way the final size of the forward TensorArray is known when this operation is called. A note about the source attribute: TensorArray gradient calls use an accumulator TensorArray object. If multiple gradients are calculated and run in the same session, the multiple gradient nodes may accidentally flow through the same accumulator TensorArray. This double counts and generally breaks the TensorArray gradient flow. The solution is to identify which gradient call this particular TensorArray gradient is being called in. This is performed by identifying a unique string (e.g. "gradients", "gradients_1", ...) from the input gradient Tensor's name. This string is used as a suffix when creating the TensorArray gradient object here (the attribute source). The attribute source is added as a suffix to the forward TensorArray's name when performing the creation / lookup, so that each separate gradient calculation gets its own TensorArray accumulator.
Args
handle A Tensor of type resource. The handle to the forward TensorArray.
flow_in A Tensor of type float32. A float scalar that enforces proper chaining of operations.
source A string. The gradient source string, used to decide which gradient TensorArray to return.
name A name for the operation (optional).
Returns A tuple of Tensor objects (grad_handle, flow_out). grad_handle A Tensor of type resource.
flow_out A Tensor of type float32. | tensorflow.raw_ops.tensorarraygradv3 |
tf.raw_ops.TensorArrayGradWithShape Creates a TensorArray for storing multiple gradients of values in the given handle. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayGradWithShape
tf.raw_ops.TensorArrayGradWithShape(
handle, flow_in, shape_to_prepend, source, name=None
)
Similar to TensorArrayGradV3. However it creates an accumulator with an expanded shape compared to the input TensorArray whose gradient is being computed. This enables multiple gradients for the same TensorArray to be calculated using the same accumulator.
Args
handle A Tensor of type resource. The handle to the forward TensorArray.
flow_in A Tensor of type float32. A float scalar that enforces proper chaining of operations.
shape_to_prepend A Tensor of type int32. An int32 vector representing a shape. Elements in the gradient accumulator will have shape which is this shape_to_prepend value concatenated with shape of the elements in the TensorArray corresponding to the input handle.
source A string. The gradient source string, used to decide which gradient TensorArray to return.
name A name for the operation (optional).
Returns A tuple of Tensor objects (grad_handle, flow_out). grad_handle A Tensor of type resource.
flow_out A Tensor of type float32. | tensorflow.raw_ops.tensorarraygradwithshape |
tf.raw_ops.TensorArrayPack View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayPack
tf.raw_ops.TensorArrayPack(
handle, flow_in, dtype, element_shape=None, name=None
)
Args
handle A Tensor of type mutable string.
flow_in A Tensor of type float32.
dtype A tf.DType.
element_shape An optional tf.TensorShape or list of ints. Defaults to None.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.tensorarraypack |
tf.raw_ops.TensorArrayRead View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayRead
tf.raw_ops.TensorArrayRead(
handle, index, flow_in, dtype, name=None
)
Args
handle A Tensor of type mutable string.
index A Tensor of type int32.
flow_in A Tensor of type float32.
dtype A tf.DType.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.tensorarrayread |
tf.raw_ops.TensorArrayReadV2 Deprecated. Use TensorArrayReadV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayReadV2
tf.raw_ops.TensorArrayReadV2(
handle, index, flow_in, dtype, name=None
)
Args
handle A Tensor of type string.
index A Tensor of type int32.
flow_in A Tensor of type float32.
dtype A tf.DType.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.tensorarrayreadv2 |
tf.raw_ops.TensorArrayReadV3 Read an element from the TensorArray into output value. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayReadV3
tf.raw_ops.TensorArrayReadV3(
handle, index, flow_in, dtype, name=None
)
Args
handle A Tensor of type resource. The handle to a TensorArray.
index A Tensor of type int32.
flow_in A Tensor of type float32. A float scalar that enforces proper chaining of operations.
dtype A tf.DType. The type of the elem that is returned.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.tensorarrayreadv3 |
tf.raw_ops.TensorArrayScatter View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayScatter
tf.raw_ops.TensorArrayScatter(
handle, indices, value, flow_in, name=None
)
Args
handle A Tensor of type mutable string.
indices A Tensor of type int32.
value A Tensor.
flow_in A Tensor of type float32.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarrayscatter |
tf.raw_ops.TensorArrayScatterV2 Deprecated. Use TensorArrayScatterV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayScatterV2
tf.raw_ops.TensorArrayScatterV2(
handle, indices, value, flow_in, name=None
)
Args
handle A Tensor of type string.
indices A Tensor of type int32.
value A Tensor.
flow_in A Tensor of type float32.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarrayscatterv2 |
tf.raw_ops.TensorArrayScatterV3 Scatter the data from the input value into specific TensorArray elements. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayScatterV3
tf.raw_ops.TensorArrayScatterV3(
handle, indices, value, flow_in, name=None
)
indices must be a vector, its length must match the first dim of value.
Args
handle A Tensor of type resource. The handle to a TensorArray.
indices A Tensor of type int32. The locations at which to write the tensor elements.
value A Tensor. The concatenated tensor to write to the TensorArray.
flow_in A Tensor of type float32. A float scalar that enforces proper chaining of operations.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarrayscatterv3 |
tf.raw_ops.TensorArraySize View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArraySize
tf.raw_ops.TensorArraySize(
handle, flow_in, name=None
)
Args
handle A Tensor of type mutable string.
flow_in A Tensor of type float32.
name A name for the operation (optional).
Returns A Tensor of type int32. | tensorflow.raw_ops.tensorarraysize |
tf.raw_ops.TensorArraySizeV2 Deprecated. Use TensorArraySizeV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArraySizeV2
tf.raw_ops.TensorArraySizeV2(
handle, flow_in, name=None
)
Args
handle A Tensor of type string.
flow_in A Tensor of type float32.
name A name for the operation (optional).
Returns A Tensor of type int32. | tensorflow.raw_ops.tensorarraysizev2 |
tf.raw_ops.TensorArraySizeV3 Get the current size of the TensorArray. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArraySizeV3
tf.raw_ops.TensorArraySizeV3(
handle, flow_in, name=None
)
Args
handle A Tensor of type resource. The handle to a TensorArray (output of TensorArray or TensorArrayGrad).
flow_in A Tensor of type float32. A float scalar that enforces proper chaining of operations.
name A name for the operation (optional).
Returns A Tensor of type int32. | tensorflow.raw_ops.tensorarraysizev3 |
tf.raw_ops.TensorArraySplit View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArraySplit
tf.raw_ops.TensorArraySplit(
handle, value, lengths, flow_in, name=None
)
Args
handle A Tensor of type mutable string.
value A Tensor.
lengths A Tensor of type int64.
flow_in A Tensor of type float32.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarraysplit |
tf.raw_ops.TensorArraySplitV2 Deprecated. Use TensorArraySplitV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArraySplitV2
tf.raw_ops.TensorArraySplitV2(
handle, value, lengths, flow_in, name=None
)
Args
handle A Tensor of type string.
value A Tensor.
lengths A Tensor of type int64.
flow_in A Tensor of type float32.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarraysplitv2 |
tf.raw_ops.TensorArraySplitV3 Split the data from the input value into TensorArray elements. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArraySplitV3
tf.raw_ops.TensorArraySplitV3(
handle, value, lengths, flow_in, name=None
)
Assuming that lengths takes on values (n0, n1, ..., n(T-1)) and that value has shape (n0 + n1 + ... + n(T-1) x d0 x d1 x ...), this splits values into a TensorArray with T tensors. TensorArray index t will be the subtensor of values with starting position (n0 + n1 + ... + n(t-1), 0, 0, ...) and having size nt x d0 x d1 x ...
Args
handle A Tensor of type resource. The handle to a TensorArray.
value A Tensor. The concatenated tensor to write to the TensorArray.
lengths A Tensor of type int64. The vector of lengths, how to split the rows of value into the TensorArray.
flow_in A Tensor of type float32. A float scalar that enforces proper chaining of operations.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarraysplitv3 |
tf.raw_ops.TensorArrayUnpack View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayUnpack
tf.raw_ops.TensorArrayUnpack(
handle, value, flow_in, name=None
)
Args
handle A Tensor of type mutable string.
value A Tensor.
flow_in A Tensor of type float32.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarrayunpack |
tf.raw_ops.TensorArrayV2 Deprecated. Use TensorArrayV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayV2
tf.raw_ops.TensorArrayV2(
size, dtype, element_shape=None, dynamic_size=False, clear_after_read=True,
tensor_array_name='', name=None
)
Args
size A Tensor of type int32.
dtype A tf.DType.
element_shape An optional tf.TensorShape or list of ints. Defaults to None.
dynamic_size An optional bool. Defaults to False.
clear_after_read An optional bool. Defaults to True.
tensor_array_name An optional string. Defaults to "".
name A name for the operation (optional).
Returns A Tensor of type string. | tensorflow.raw_ops.tensorarrayv2 |
tf.raw_ops.TensorArrayV3 An array of Tensors of given size. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayV3
tf.raw_ops.TensorArrayV3(
size, dtype, element_shape=None, dynamic_size=False, clear_after_read=True,
identical_element_shapes=False, tensor_array_name='', name=None
)
Write data via Write and read via Read or Pack.
Args
size A Tensor of type int32. The size of the array.
dtype A tf.DType. The type of the elements on the tensor_array.
element_shape An optional tf.TensorShape or list of ints. Defaults to None. The expected shape of an element, if known. Used to validate the shapes of TensorArray elements. If this shape is not fully specified, gathering zero-size TensorArrays is an error.
dynamic_size An optional bool. Defaults to False. A boolean that determines whether writes to the TensorArray are allowed to grow the size. By default, this is not allowed.
clear_after_read An optional bool. Defaults to True. If true (default), Tensors in the TensorArray are cleared after being read. This disables multiple read semantics but allows early release of memory.
identical_element_shapes An optional bool. Defaults to False. If true (default is false), then all elements in the TensorArray will be expected to have have identical shapes. This allows certain behaviors, like dynamically checking for consistent shapes on write, and being able to fill in properly shaped zero tensors on stack -- even if the element_shape attribute is not fully defined.
tensor_array_name An optional string. Defaults to "". Overrides the name used for the temporary tensor_array resource. Default value is the name of the 'TensorArray' op (which is guaranteed unique).
name A name for the operation (optional).
Returns A tuple of Tensor objects (handle, flow). handle A Tensor of type resource.
flow A Tensor of type float32. | tensorflow.raw_ops.tensorarrayv3 |
tf.raw_ops.TensorArrayWrite View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayWrite
tf.raw_ops.TensorArrayWrite(
handle, index, value, flow_in, name=None
)
Args
handle A Tensor of type mutable string.
index A Tensor of type int32.
value A Tensor.
flow_in A Tensor of type float32.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarraywrite |
tf.raw_ops.TensorArrayWriteV2 Deprecated. Use TensorArrayGradV3 View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayWriteV2
tf.raw_ops.TensorArrayWriteV2(
handle, index, value, flow_in, name=None
)
Args
handle A Tensor of type string.
index A Tensor of type int32.
value A Tensor.
flow_in A Tensor of type float32.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarraywritev2 |
tf.raw_ops.TensorArrayWriteV3 Push an element onto the tensor_array. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorArrayWriteV3
tf.raw_ops.TensorArrayWriteV3(
handle, index, value, flow_in, name=None
)
Args
handle A Tensor of type resource. The handle to a TensorArray.
index A Tensor of type int32. The position to write to inside the TensorArray.
value A Tensor. The tensor to write to the TensorArray.
flow_in A Tensor of type float32. A float scalar that enforces proper chaining of operations.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tensorarraywritev3 |
tf.raw_ops.TensorDataset Creates a dataset that emits components as a tuple of tensors once. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorDataset
tf.raw_ops.TensorDataset(
components, output_shapes, name=None
)
Args
components A list of Tensor objects.
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.tensordataset |
tf.raw_ops.TensorListConcat Concats all tensors in the list along the 0th dimension. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListConcat
tf.raw_ops.TensorListConcat(
input_handle, element_dtype, element_shape=None, name=None
)
Requires that all tensors have the same shape except the first dimension. input_handle: The input list. tensor: The concated result. lengths: Output tensor containing sizes of the 0th dimension of tensors in the list, used for computing the gradient.
Args
input_handle A Tensor of type variant.
element_dtype A tf.DType.
element_shape An optional tf.TensorShape or list of ints. Defaults to None.
name A name for the operation (optional).
Returns A tuple of Tensor objects (tensor, lengths). tensor A Tensor of type element_dtype.
lengths A Tensor of type int64. | tensorflow.raw_ops.tensorlistconcat |
tf.raw_ops.TensorListConcatLists View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListConcatLists
tf.raw_ops.TensorListConcatLists(
input_a, input_b, element_dtype, name=None
)
Args
input_a A Tensor of type variant.
input_b A Tensor of type variant.
element_dtype A tf.DType.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistconcatlists |
tf.raw_ops.TensorListConcatV2 Concats all tensors in the list along the 0th dimension. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListConcatV2
tf.raw_ops.TensorListConcatV2(
input_handle, element_shape, leading_dims, element_dtype, name=None
)
Requires that all tensors have the same shape except the first dimension. input_handle: The input list. element_shape: The shape of the uninitialized elements in the list. If the first dimension is not -1, it is assumed that all list elements have the same leading dim. leading_dims: The list of leading dims of uninitialized list elements. Used if the leading dim of input_handle.element_shape or the element_shape input arg is not already set. tensor: The concated result. lengths: Output tensor containing sizes of the 0th dimension of tensors in the list, used for computing the gradient.
Args
input_handle A Tensor of type variant.
element_shape A Tensor. Must be one of the following types: int32, int64.
leading_dims A Tensor of type int64.
element_dtype A tf.DType.
name A name for the operation (optional).
Returns A tuple of Tensor objects (tensor, lengths). tensor A Tensor of type element_dtype.
lengths A Tensor of type int64. | tensorflow.raw_ops.tensorlistconcatv2 |
tf.raw_ops.TensorListElementShape The shape of the elements of the given list, as a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListElementShape
tf.raw_ops.TensorListElementShape(
input_handle, shape_type, name=None
)
input_handle: the list element_shape: the shape of elements of the list
Args
input_handle A Tensor of type variant.
shape_type A tf.DType from: tf.int32, tf.int64.
name A name for the operation (optional).
Returns A Tensor of type shape_type. | tensorflow.raw_ops.tensorlistelementshape |
tf.raw_ops.TensorListFromTensor Creates a TensorList which, when stacked, has the value of tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListFromTensor
tf.raw_ops.TensorListFromTensor(
tensor, element_shape, name=None
)
Each tensor in the result list corresponds to one row of the input tensor. tensor: The input tensor. output_handle: The list.
Args
tensor A Tensor.
element_shape A Tensor. Must be one of the following types: int32, int64.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistfromtensor |
tf.raw_ops.TensorListGather Creates a Tensor by indexing into the TensorList. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListGather
tf.raw_ops.TensorListGather(
input_handle, indices, element_shape, element_dtype, name=None
)
Each row in the produced Tensor corresponds to the element in the TensorList specified by the given index (see tf.gather). input_handle: The input tensor list. indices: The indices used to index into the list. values: The tensor.
Args
input_handle A Tensor of type variant.
indices A Tensor of type int32.
element_shape A Tensor of type int32.
element_dtype A tf.DType.
name A name for the operation (optional).
Returns A Tensor of type element_dtype. | tensorflow.raw_ops.tensorlistgather |
tf.raw_ops.TensorListGetItem Returns the item in the list with the given index. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListGetItem
tf.raw_ops.TensorListGetItem(
input_handle, index, element_shape, element_dtype, name=None
)
input_handle: the list index: the position in the list from which an element will be retrieved item: the element at that position
Args
input_handle A Tensor of type variant.
index A Tensor of type int32.
element_shape A Tensor of type int32.
element_dtype A tf.DType.
name A name for the operation (optional).
Returns A Tensor of type element_dtype. | tensorflow.raw_ops.tensorlistgetitem |
tf.raw_ops.TensorListLength Returns the number of tensors in the input tensor list. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListLength
tf.raw_ops.TensorListLength(
input_handle, name=None
)
input_handle: the input list length: the number of tensors in the list
Args
input_handle A Tensor of type variant.
name A name for the operation (optional).
Returns A Tensor of type int32. | tensorflow.raw_ops.tensorlistlength |
tf.raw_ops.TensorListPopBack Returns the last element of the input list as well as a list with all but that element. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListPopBack
tf.raw_ops.TensorListPopBack(
input_handle, element_shape, element_dtype, name=None
)
Fails if the list is empty. input_handle: the input list tensor: the withdrawn last element of the list element_dtype: the type of elements in the list element_shape: the shape of the output tensor
Args
input_handle A Tensor of type variant.
element_shape A Tensor of type int32.
element_dtype A tf.DType.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output_handle, tensor). output_handle A Tensor of type variant.
tensor A Tensor of type element_dtype. | tensorflow.raw_ops.tensorlistpopback |
tf.raw_ops.TensorListPushBack Returns a list which has the passed-in Tensor as last element and the other elements of the given list in input_handle. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListPushBack
tf.raw_ops.TensorListPushBack(
input_handle, tensor, name=None
)
tensor: The tensor to put on the list. input_handle: The old list. output_handle: A list with the elements of the old list followed by tensor. element_dtype: the type of elements in the list. element_shape: a shape compatible with that of elements in the list.
Args
input_handle A Tensor of type variant.
tensor A Tensor.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistpushback |
tf.raw_ops.TensorListPushBackBatch View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListPushBackBatch
tf.raw_ops.TensorListPushBackBatch(
input_handles, tensor, name=None
)
Args
input_handles A Tensor of type variant.
tensor A Tensor.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistpushbackbatch |
tf.raw_ops.TensorListReserve List of the given size with empty elements. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListReserve
tf.raw_ops.TensorListReserve(
element_shape, num_elements, element_dtype, name=None
)
element_shape: the shape of the future elements of the list num_elements: the number of elements to reserve handle: the output list element_dtype: the desired type of elements in the list.
Args
element_shape A Tensor. Must be one of the following types: int32, int64.
num_elements A Tensor of type int32.
element_dtype A tf.DType.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistreserve |
tf.raw_ops.TensorListResize Resizes the list. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListResize
tf.raw_ops.TensorListResize(
input_handle, size, name=None
)
input_handle: the input list size: size of the output list
Args
input_handle A Tensor of type variant.
size A Tensor of type int32.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistresize |
tf.raw_ops.TensorListScatter Creates a TensorList by indexing into a Tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListScatter
tf.raw_ops.TensorListScatter(
tensor, indices, element_shape, name=None
)
Each member of the TensorList corresponds to one row of the input tensor, specified by the given index (see tf.gather). tensor: The input tensor. indices: The indices used to index into the list. element_shape: The shape of the elements in the list (can be less specified than the shape of the tensor). output_handle: The TensorList.
Args
tensor A Tensor.
indices A Tensor of type int32.
element_shape A Tensor. Must be one of the following types: int32, int64.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistscatter |
tf.raw_ops.TensorListScatterIntoExistingList Scatters tensor at indices in an input list. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListScatterIntoExistingList
tf.raw_ops.TensorListScatterIntoExistingList(
input_handle, tensor, indices, name=None
)
Each member of the TensorList corresponds to one row of the input tensor, specified by the given index (see tf.gather). input_handle: The list to scatter into. tensor: The input tensor. indices: The indices used to index into the list. output_handle: The TensorList.
Args
input_handle A Tensor of type variant.
tensor A Tensor.
indices A Tensor of type int32.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistscatterintoexistinglist |
tf.raw_ops.TensorListScatterV2 Creates a TensorList by indexing into a Tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListScatterV2
tf.raw_ops.TensorListScatterV2(
tensor, indices, element_shape, num_elements, name=None
)
Each member of the TensorList corresponds to one row of the input tensor, specified by the given index (see tf.gather). tensor: The input tensor. indices: The indices used to index into the list. element_shape: The shape of the elements in the list (can be less specified than the shape of the tensor). num_elements: The size of the output list. Must be large enough to accommodate the largest index in indices. If -1, the list is just large enough to include the largest index in indices. output_handle: The TensorList.
Args
tensor A Tensor.
indices A Tensor of type int32.
element_shape A Tensor. Must be one of the following types: int32, int64.
num_elements A Tensor of type int32.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistscatterv2 |
tf.raw_ops.TensorListSetItem Sets the index-th position of the list to contain the given tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListSetItem
tf.raw_ops.TensorListSetItem(
input_handle, index, item, name=None
)
input_handle: the list index: the position in the list to which the tensor will be assigned item: the element to be assigned to that position output_handle: the new list, with the element in the proper position
Args
input_handle A Tensor of type variant.
index A Tensor of type int32.
item A Tensor.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistsetitem |
tf.raw_ops.TensorListSplit Splits a tensor into a list. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListSplit
tf.raw_ops.TensorListSplit(
tensor, element_shape, lengths, name=None
)
list[i] corresponds to lengths[i] tensors from the input tensor. The tensor must have rank at least 1 and contain exactly sum(lengths) elements. tensor: The input tensor. element_shape: A shape compatible with that of elements in the tensor. lengths: Vector of sizes of the 0th dimension of tensors in the list. output_handle: The list.
Args
tensor A Tensor.
element_shape A Tensor. Must be one of the following types: int32, int64.
lengths A Tensor of type int64.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tensorlistsplit |
tf.raw_ops.TensorListStack Stacks all tensors in the list. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorListStack
tf.raw_ops.TensorListStack(
input_handle, element_shape, element_dtype, num_elements=-1, name=None
)
Requires that all tensors have the same shape. input_handle: the input list tensor: the gathered result num_elements: optional. If not -1, the number of elements in the list.
Args
input_handle A Tensor of type variant.
element_shape A Tensor of type int32.
element_dtype A tf.DType.
num_elements An optional int. Defaults to -1.
name A name for the operation (optional).
Returns A Tensor of type element_dtype. | tensorflow.raw_ops.tensorliststack |
tf.raw_ops.TensorScatterAdd Adds sparse updates to an existing tensor according to indices. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorScatterAdd
tf.raw_ops.TensorScatterAdd(
tensor, indices, updates, name=None
)
This operation creates a new tensor by adding sparse updates to the passed in tensor. This operation is very similar to tf.scatter_nd_add, except that the updates are added onto an existing tensor (as opposed to a variable). If the memory for the existing tensor cannot be re-used, a copy is made and updated. indices is an integer tensor containing indices into a new tensor of shape tensor.shape. The last dimension of indices can be at most the rank of tensor.shape: indices.shape[-1] <= tensor.shape.rank
The last dimension of indices corresponds to indices into elements (if indices.shape[-1] = tensor.shape.rank) or slices (if indices.shape[-1] < tensor.shape.rank) along dimension indices.shape[-1] of tensor.shape. updates is a tensor with shape indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
The simplest form of tensor_scatter_add is to add individual elements to a tensor by index. For example, say we want to add 4 elements in a rank-1 tensor with 8 elements. In Python, this scatter add operation would look like this: indices = tf.constant([[4], [3], [1], [7]])
updates = tf.constant([9, 10, 11, 12])
tensor = tf.ones([8], dtype=tf.int32)
updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
print(updated)
The resulting tensor would look like this: [1, 12, 1, 11, 10, 1, 1, 13]
We can also, insert entire slices of a higher rank tensor all at once. For example, if we wanted to insert two slices in the first dimension of a rank-3 tensor with two matrices of new values. In Python, this scatter add operation would look like this: indices = tf.constant([[0], [2]])
updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6],
[7, 7, 7, 7], [8, 8, 8, 8]],
[[5, 5, 5, 5], [6, 6, 6, 6],
[7, 7, 7, 7], [8, 8, 8, 8]]])
tensor = tf.ones([4, 4, 4],dtype=tf.int32)
updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
print(updated)
The resulting tensor would look like this: [[[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]],
[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
[[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]],
[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]]
Note that on CPU, if an out of bound index is found, an error is returned. On GPU, if an out of bound index is found, the index is ignored.
Args
tensor A Tensor. Tensor to copy/update.
indices A Tensor. Must be one of the following types: int32, int64. Index tensor.
updates A Tensor. Must have the same type as tensor. Updates to scatter into output.
name A name for the operation (optional).
Returns A Tensor. Has the same type as tensor. | tensorflow.raw_ops.tensorscatteradd |
tf.raw_ops.TensorScatterMax View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorScatterMax
tf.raw_ops.TensorScatterMax(
tensor, indices, updates, name=None
)
Args
tensor A Tensor. Tensor to update.
indices A Tensor. Must be one of the following types: int32, int64. Index tensor.
updates A Tensor. Must have the same type as tensor. Updates to scatter into output.
name A name for the operation (optional).
Returns A Tensor. Has the same type as tensor. | tensorflow.raw_ops.tensorscattermax |
tf.raw_ops.TensorScatterMin View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorScatterMin
tf.raw_ops.TensorScatterMin(
tensor, indices, updates, name=None
)
Args
tensor A Tensor. Tensor to update.
indices A Tensor. Must be one of the following types: int32, int64. Index tensor.
updates A Tensor. Must have the same type as tensor. Updates to scatter into output.
name A name for the operation (optional).
Returns A Tensor. Has the same type as tensor. | tensorflow.raw_ops.tensorscattermin |
tf.raw_ops.TensorScatterSub Subtracts sparse updates from an existing tensor according to indices. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorScatterSub
tf.raw_ops.TensorScatterSub(
tensor, indices, updates, name=None
)
This operation creates a new tensor by subtracting sparse updates from the passed in tensor. This operation is very similar to tf.scatter_nd_sub, except that the updates are subtracted from an existing tensor (as opposed to a variable). If the memory for the existing tensor cannot be re-used, a copy is made and updated. indices is an integer tensor containing indices into a new tensor of shape shape. The last dimension of indices can be at most the rank of shape: indices.shape[-1] <= shape.rank
The last dimension of indices corresponds to indices into elements (if indices.shape[-1] = shape.rank) or slices (if indices.shape[-1] < shape.rank) along dimension indices.shape[-1] of shape. updates is a tensor with shape indices.shape[:-1] + shape[indices.shape[-1]:]
The simplest form of tensor_scatter_sub is to subtract individual elements from a tensor by index. For example, say we want to insert 4 scattered elements in a rank-1 tensor with 8 elements. In Python, this scatter subtract operation would look like this: indices = tf.constant([[4], [3], [1], [7]])
updates = tf.constant([9, 10, 11, 12])
tensor = tf.ones([8], dtype=tf.int32)
updated = tf.tensor_scatter_nd_sub(tensor, indices, updates)
print(updated)
The resulting tensor would look like this: [1, -10, 1, -9, -8, 1, 1, -11]
We can also, insert entire slices of a higher rank tensor all at once. For example, if we wanted to insert two slices in the first dimension of a rank-3 tensor with two matrices of new values. In Python, this scatter add operation would look like this: indices = tf.constant([[0], [2]])
updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6],
[7, 7, 7, 7], [8, 8, 8, 8]],
[[5, 5, 5, 5], [6, 6, 6, 6],
[7, 7, 7, 7], [8, 8, 8, 8]]])
tensor = tf.ones([4, 4, 4],dtype=tf.int32)
updated = tf.tensor_scatter_nd_sub(tensor, indices, updates)
print(updated)
The resulting tensor would look like this: [[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]]
Note that on CPU, if an out of bound index is found, an error is returned. On GPU, if an out of bound index is found, the index is ignored.
Args
tensor A Tensor. Tensor to copy/update.
indices A Tensor. Must be one of the following types: int32, int64. Index tensor.
updates A Tensor. Must have the same type as tensor. Updates to scatter into output.
name A name for the operation (optional).
Returns A Tensor. Has the same type as tensor. | tensorflow.raw_ops.tensorscattersub |
tf.raw_ops.TensorScatterUpdate Scatter updates into an existing tensor according to indices. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorScatterUpdate
tf.raw_ops.TensorScatterUpdate(
tensor, indices, updates, name=None
)
This operation creates a new tensor by applying sparse updates to the passed in tensor. This operation is very similar to tf.scatter_nd, except that the updates are scattered onto an existing tensor (as opposed to a zero-tensor). If the memory for the existing tensor cannot be re-used, a copy is made and updated. If indices contains duplicates, then we pick the last update for the index. If an out of bound index is found on CPU, an error is returned. Warning: There are some GPU specific semantics for this operation. If an out of bound index is found, the index is ignored. The order in which updates are applied is nondeterministic, so the output will be nondeterministic if indices contains duplicates. indices is an integer tensor containing indices into a new tensor of shape shape.
indices must have at least 2 axes: (num_updates, index_depth). The last axis of indices is how deep to index into tensor so this index depth must be less than the rank of tensor: indices.shape[-1] <= tensor.ndim
if indices.shape[-1] = tensor.rank this Op indexes and updates scalar elements. if indices.shape[-1] < tensor.rank it indexes and updates slices of the input tensor. Each update has a rank of tensor.rank - indices.shape[-1]. The overall shape of updates is: indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
For usage examples see the python tf.tensor_scatter_nd_update function
Args
tensor A Tensor. Tensor to copy/update.
indices A Tensor. Must be one of the following types: int32, int64. Index tensor.
updates A Tensor. Must have the same type as tensor. Updates to scatter into output.
name A name for the operation (optional).
Returns A Tensor. Has the same type as tensor. | tensorflow.raw_ops.tensorscatterupdate |
tf.raw_ops.TensorSliceDataset Creates a dataset that emits each dim-0 slice of components once. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorSliceDataset
tf.raw_ops.TensorSliceDataset(
components, output_shapes, name=None
)
Args
components A list of Tensor objects.
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.tensorslicedataset |
tf.raw_ops.TensorStridedSliceUpdate Assign value to the sliced l-value reference of input. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorStridedSliceUpdate
tf.raw_ops.TensorStridedSliceUpdate(
input, begin, end, strides, value, begin_mask=0, end_mask=0, ellipsis_mask=0,
new_axis_mask=0, shrink_axis_mask=0, name=None
)
The values of value are assigned to the positions in the tensor input that are selected by the slice parameters. The slice parameters begin end strides etc. work exactly as in StridedSlice. NOTE this op currently does not support broadcasting and so value's shape must be exactly the shape produced by the slice of input.
Args
input A Tensor.
begin A Tensor. Must be one of the following types: int32, int64.
end A Tensor. Must have the same type as begin.
strides A Tensor. Must have the same type as begin.
value A Tensor. Must have the same type as input.
begin_mask An optional int. Defaults to 0.
end_mask An optional int. Defaults to 0.
ellipsis_mask An optional int. Defaults to 0.
new_axis_mask An optional int. Defaults to 0.
shrink_axis_mask An optional int. Defaults to 0.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.tensorstridedsliceupdate |
tf.raw_ops.TensorSummary Outputs a Summary protocol buffer with a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorSummary
tf.raw_ops.TensorSummary(
tensor, description='', labels=[], display_name='',
name=None
)
This op is being phased out in favor of TensorSummaryV2, which lets callers pass a tag as well as a serialized SummaryMetadata proto string that contains plugin-specific data. We will keep this op to maintain backwards compatibility.
Args
tensor A Tensor. A tensor to serialize.
description An optional string. Defaults to "". A json-encoded SummaryDescription proto.
labels An optional list of strings. Defaults to []. An unused list of strings.
display_name An optional string. Defaults to "". An unused string.
name A name for the operation (optional).
Returns A Tensor of type string. | tensorflow.raw_ops.tensorsummary |
tf.raw_ops.TensorSummaryV2 Outputs a Summary protocol buffer with a tensor and per-plugin data. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TensorSummaryV2
tf.raw_ops.TensorSummaryV2(
tag, tensor, serialized_summary_metadata, name=None
)
Args
tag A Tensor of type string. A string attached to this summary. Used for organization in TensorBoard.
tensor A Tensor. A tensor to serialize.
serialized_summary_metadata A Tensor of type string. A serialized SummaryMetadata proto. Contains plugin data.
name A name for the operation (optional).
Returns A Tensor of type string. | tensorflow.raw_ops.tensorsummaryv2 |
tf.raw_ops.TextLineDataset Creates a dataset that emits the lines of one or more text files. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TextLineDataset
tf.raw_ops.TextLineDataset(
filenames, compression_type, buffer_size, name=None
)
Args
filenames A Tensor of type string. A scalar or a vector containing the name(s) of the file(s) to be read.
compression_type A Tensor of type string. A scalar containing either (i) the empty string (no compression), (ii) "ZLIB", or (iii) "GZIP".
buffer_size A Tensor of type int64. A scalar containing the number of bytes to buffer.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.textlinedataset |
tf.raw_ops.TextLineReader A Reader that outputs the lines of a file delimited by '\n'. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TextLineReader
tf.raw_ops.TextLineReader(
skip_header_lines=0, container='', shared_name='', name=None
)
Args
skip_header_lines An optional int. Defaults to 0. Number of lines to skip from the beginning of every file.
container An optional string. Defaults to "". If non-empty, this reader is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this reader is named in the given bucket with this shared_name. Otherwise, the node name is used instead.
name A name for the operation (optional).
Returns A Tensor of type mutable string. | tensorflow.raw_ops.textlinereader |
tf.raw_ops.TextLineReaderV2 A Reader that outputs the lines of a file delimited by '\n'. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TextLineReaderV2
tf.raw_ops.TextLineReaderV2(
skip_header_lines=0, container='', shared_name='', name=None
)
Args
skip_header_lines An optional int. Defaults to 0. Number of lines to skip from the beginning of every file.
container An optional string. Defaults to "". If non-empty, this reader is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this reader is named in the given bucket with this shared_name. Otherwise, the node name is used instead.
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.textlinereaderv2 |
tf.raw_ops.TFRecordDataset Creates a dataset that emits the records from one or more TFRecord files. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TFRecordDataset
tf.raw_ops.TFRecordDataset(
filenames, compression_type, buffer_size, name=None
)
Args
filenames A Tensor of type string. A scalar or vector containing the name(s) of the file(s) to be read.
compression_type A Tensor of type string. A scalar containing either (i) the empty string (no compression), (ii) "ZLIB", or (iii) "GZIP".
buffer_size A Tensor of type int64. A scalar representing the number of bytes to buffer. A value of 0 means no buffering will be performed.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.tfrecorddataset |
tf.raw_ops.TFRecordReader A Reader that outputs the records from a TensorFlow Records file. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TFRecordReader
tf.raw_ops.TFRecordReader(
container='', shared_name='', compression_type='',
name=None
)
Args
container An optional string. Defaults to "". If non-empty, this reader is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this reader is named in the given bucket with this shared_name. Otherwise, the node name is used instead.
compression_type An optional string. Defaults to "".
name A name for the operation (optional).
Returns A Tensor of type mutable string. | tensorflow.raw_ops.tfrecordreader |
tf.raw_ops.TFRecordReaderV2 A Reader that outputs the records from a TensorFlow Records file. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TFRecordReaderV2
tf.raw_ops.TFRecordReaderV2(
container='', shared_name='', compression_type='',
name=None
)
Args
container An optional string. Defaults to "". If non-empty, this reader is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this reader is named in the given bucket with this shared_name. Otherwise, the node name is used instead.
compression_type An optional string. Defaults to "".
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.tfrecordreaderv2 |
tf.raw_ops.ThreadPoolDataset 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.ThreadPoolDataset
tf.raw_ops.ThreadPoolDataset(
input_dataset, thread_pool, output_types, output_shapes, name=None
)
Args
input_dataset A Tensor of type variant.
thread_pool A Tensor of type resource. A resource produced by the ThreadPoolHandle op.
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.threadpooldataset |
tf.raw_ops.ThreadPoolHandle 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.ThreadPoolHandle
tf.raw_ops.ThreadPoolHandle(
num_threads, display_name, max_intra_op_parallelism=1, container='',
shared_name='', name=None
)
Args
num_threads An int. The number of threads in the thread pool.
display_name A string. A human-readable name for the threads that may be visible in some visualizations. threadpool.
max_intra_op_parallelism An optional int. Defaults to 1. The maximum degree of parallelism to use within operations that execute on this threadpool.
container An optional string. Defaults to "".
shared_name An optional string. Defaults to "".
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.threadpoolhandle |
tf.raw_ops.ThreadUnsafeUnigramCandidateSampler Generates labels for candidate sampling with a learned unigram distribution. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ThreadUnsafeUnigramCandidateSampler
tf.raw_ops.ThreadUnsafeUnigramCandidateSampler(
true_classes, num_true, num_sampled, unique, range_max, seed=0, seed2=0,
name=None
)
See explanations of candidate sampling and the data formats at go/candidate-sampling. For each batch, this op picks a single set of sampled candidate labels. The advantages of sampling candidates per-batch are simplicity and the possibility of efficient dense matrix multiplication. The disadvantage is that the sampled candidates must be chosen independently of the context and of the true labels.
Args
true_classes A Tensor of type int64. A batch_size * num_true matrix, in which each row contains the IDs of the num_true target_classes in the corresponding original label.
num_true An int that is >= 1. Number of true labels per context.
num_sampled An int that is >= 1. Number of candidates to randomly sample.
unique A bool. If unique is true, we sample with rejection, so that all sampled candidates in a batch are unique. This requires some approximation to estimate the post-rejection sampling probabilities.
range_max An int that is >= 1. The sampler will sample integers from the interval [0, range_max).
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. An second seed to avoid seed collision.
name A name for the operation (optional).
Returns A tuple of Tensor objects (sampled_candidates, true_expected_count, sampled_expected_count). sampled_candidates A Tensor of type int64.
true_expected_count A Tensor of type float32.
sampled_expected_count A Tensor of type float32. | tensorflow.raw_ops.threadunsafeunigramcandidatesampler |
tf.raw_ops.Tile Constructs a tensor by tiling a given tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Tile
tf.raw_ops.Tile(
input, multiples, name=None
)
This operation creates a new tensor by replicating input multiples times. The output tensor's i'th dimension has input.dims(i) * multiples[i] elements, and the values of input are replicated multiples[i] times along the 'i'th dimension. For example, tiling [a b c d] by [2] produces [a b c d a b c d].
a = tf.constant([[1,2,3],[4,5,6]], tf.int32)
b = tf.constant([1,2], tf.int32)
tf.tile(a, b)
<tf.Tensor: shape=(2, 6), dtype=int32, numpy=
array([[1, 2, 3, 1, 2, 3],
[4, 5, 6, 4, 5, 6]], dtype=int32)>
c = tf.constant([2,1], tf.int32)
tf.tile(a, c)
<tf.Tensor: shape=(4, 3), dtype=int32, numpy=
array([[1, 2, 3],
[4, 5, 6],
[1, 2, 3],
[4, 5, 6]], dtype=int32)>
d = tf.constant([2,2], tf.int32)
tf.tile(a, d)
<tf.Tensor: shape=(4, 6), dtype=int32, numpy=
array([[1, 2, 3, 1, 2, 3],
[4, 5, 6, 4, 5, 6],
[1, 2, 3, 1, 2, 3],
[4, 5, 6, 4, 5, 6]], dtype=int32)>
Args
input A Tensor. 1-D or higher.
multiples A Tensor. Must be one of the following types: int32, int64. 1-D. Length must be the same as the number of dimensions in input
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.tile |
tf.raw_ops.TileGrad Returns the gradient of Tile. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TileGrad
tf.raw_ops.TileGrad(
input, multiples, name=None
)
Since Tile takes an input and repeats the input multiples times along each dimension, TileGrad takes in multiples and aggregates each repeated tile of input into output.
Args
input A Tensor.
multiples A Tensor of type int32.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.tilegrad |
tf.raw_ops.Timestamp Provides the time since epoch in seconds. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Timestamp
tf.raw_ops.Timestamp(
name=None
)
Returns the timestamp as a float64 for seconds since the Unix epoch.
Note: the timestamp is computed when the op is executed, not when it is added to the graph.
Args
name A name for the operation (optional).
Returns A Tensor of type float64. | tensorflow.raw_ops.timestamp |
tf.raw_ops.ToBool Converts a tensor to a scalar predicate. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ToBool
tf.raw_ops.ToBool(
input, name=None
)
Converts a tensor to a scalar predicate with the following rules: For 0D tensors, truthiness is determined by comparing against a "zero" value. For numerical types it is the obvious zero. For strings it is the empty string. For >0D tensors, truthiness is determined by looking at the number of elements. If has zero elements, then the result is false. Otherwise the result is true. This matches the behavior of If and While for determining if a tensor counts as true/false for a branch condition.
Args
input A Tensor.
name A name for the operation (optional).
Returns A Tensor of type bool. | tensorflow.raw_ops.tobool |
tf.raw_ops.TopK Finds values and indices of the k largest elements for the last dimension. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TopK
tf.raw_ops.TopK(
input, k, sorted=True, name=None
)
If the input is a vector (rank-1), finds the k largest entries in the vector and outputs their values and indices as vectors. Thus values[j] is the j-th largest entry in input, and its index is indices[j]. For matrices (resp. higher rank input), computes the top k entries in each row (resp. vector along the last dimension). Thus, values.shape = indices.shape = input.shape[:-1] + [k]
If two elements are equal, the lower-index element appears first. If k varies dynamically, use TopKV2 below.
Args
input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. 1-D or higher with last dimension at least k.
k An int that is >= 0. Number of top elements to look for along the last dimension (along each row for matrices).
sorted An optional bool. Defaults to True. If true the resulting k elements will be sorted by the values in descending order.
name A name for the operation (optional).
Returns A tuple of Tensor objects (values, indices). values A Tensor. Has the same type as input.
indices A Tensor of type int32. | tensorflow.raw_ops.topk |
tf.raw_ops.TopKV2 Finds values and indices of the k largest elements for the last dimension. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TopKV2
tf.raw_ops.TopKV2(
input, k, sorted=True, name=None
)
If the input is a vector (rank-1), finds the k largest entries in the vector and outputs their values and indices as vectors. Thus values[j] is the j-th largest entry in input, and its index is indices[j]. For matrices (resp. higher rank input), computes the top k entries in each row (resp. vector along the last dimension). Thus, values.shape = indices.shape = input.shape[:-1] + [k]
If two elements are equal, the lower-index element appears first.
Args
input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. 1-D or higher with last dimension at least k.
k A Tensor of type int32. 0-D. Number of top elements to look for along the last dimension (along each row for matrices).
sorted An optional bool. Defaults to True. If true the resulting k elements will be sorted by the values in descending order.
name A name for the operation (optional).
Returns A tuple of Tensor objects (values, indices). values A Tensor. Has the same type as input.
indices A Tensor of type int32. | tensorflow.raw_ops.topkv2 |
tf.raw_ops.TPUCompilationResult Returns the result of a TPU compilation. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TPUCompilationResult
tf.raw_ops.TPUCompilationResult(
name=None
)
This operation returns the result of a TPU compilation as a serialized CompilationResultProto, which holds a status and an error message if an error occurred during compilation.
Args
name A name for the operation (optional).
Returns A Tensor of type string. | tensorflow.raw_ops.tpucompilationresult |
tf.raw_ops.TPUEmbeddingActivations An op enabling differentiation of TPU Embeddings. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TPUEmbeddingActivations
tf.raw_ops.TPUEmbeddingActivations(
embedding_variable, sliced_activations, table_id, lookup_id, name=None
)
This op simply returns its first input, which is assumed to have been sliced from the Tensors returned by TPUEmbeddingDequeueActivations. The presence of this op, and its first argument being a trainable Variable, enables automatic differentiation of graphs containing embeddings via the TPU Embedding Python libraries.
Args
embedding_variable A Tensor of type float32. A trainable variable, enabling optimizers to find this op.
sliced_activations A Tensor of type float32. The embedding activations Tensor to return.
table_id An int that is >= 0. The id of the table in the embedding layer configuration from which these activations were computed.
lookup_id An int that is >= 0. Identifier of the set of embedding indices which produced these activations.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.tpuembeddingactivations |
tf.raw_ops.TPUOrdinalSelector A TPU core selector Op. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TPUOrdinalSelector
tf.raw_ops.TPUOrdinalSelector(
name=None
)
This Op produces a set of TPU cores (for warm-up) or a single TPU core (for regular inference) to execute the TPU program on. The output is consumed by TPUPartitionedCall.
Args
name A name for the operation (optional).
Returns A Tensor of type int32. | tensorflow.raw_ops.tpuordinalselector |
tf.raw_ops.TPUPartitionedCall Calls a function placed on a specified TPU device. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TPUPartitionedCall
tf.raw_ops.TPUPartitionedCall(
args, device_ordinal, Tout, f, autotuner_thresh=0, name=None
)
Args
args A list of Tensor objects. The arguments to the function.
device_ordinal A Tensor of type int32. The TPU device ordinal to run the function on.
Tout A list of tf.DTypes. The types of the outputs of the function.
f A function decorated with @Defun. The function to call.
autotuner_thresh An optional int. Defaults to 0.
name A name for the operation (optional).
Returns A list of Tensor objects of type Tout. | tensorflow.raw_ops.tpupartitionedcall |
tf.raw_ops.TPUReplicatedInput Connects N inputs to an N-way replicated TPU computation. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TPUReplicatedInput
tf.raw_ops.TPUReplicatedInput(
inputs, is_mirrored_variable=False, index=-1, is_packed=False, name=None
)
This operation holds a replicated input to a tpu.replicate() computation subgraph. Each replicated input has the same shape and type alongside the output. For example: %a = "tf.opA"()
%b = "tf.opB"()
%replicated_input = "tf.TPUReplicatedInput"(%a, %b)
%computation = "tf.Computation"(%replicated_input)
The above computation has a replicated input of two replicas.
Args
inputs A list of at least 1 Tensor objects with the same type.
is_mirrored_variable An optional bool. Defaults to False.
index An optional int. Defaults to -1.
is_packed An optional bool. Defaults to False.
name A name for the operation (optional).
Returns A Tensor. Has the same type as inputs. | tensorflow.raw_ops.tpureplicatedinput |
tf.raw_ops.TPUReplicatedOutput Connects N outputs from an N-way replicated TPU computation. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TPUReplicatedOutput
tf.raw_ops.TPUReplicatedOutput(
input, num_replicas, name=None
)
This operation holds a replicated output from a tpu.replicate() computation subgraph. Each replicated output has the same shape and type alongside the input. For example: %computation = "tf.Computation"()
%replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
The above computation has a replicated output of two replicas.
Args
input A Tensor.
num_replicas An int that is >= 1.
name A name for the operation (optional).
Returns A list of num_replicas Tensor objects with the same type as input. | tensorflow.raw_ops.tpureplicatedoutput |
tf.raw_ops.TPUReplicateMetadata Metadata indicating how the TPU computation should be replicated. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TPUReplicateMetadata
tf.raw_ops.TPUReplicateMetadata(
num_replicas, num_cores_per_replica=1, topology='', use_tpu=True,
device_assignment=[], computation_shape=[], host_compute_core=[],
padding_map=[], step_marker_location='STEP_MARK_AT_ENTRY',
allow_soft_placement=False, use_spmd_for_xla_partitioning=False, name=None
)
This operation holds the metadata common to operations of a tpu.replicate() computation subgraph.
Args
num_replicas An int that is >= 0. Number of replicas of the computation
num_cores_per_replica An optional int. Defaults to 1. Number of cores per replica. Used for model parallelism.
topology An optional string. Defaults to "". TopologyProto indicating the topology of the TPU pod slice.
use_tpu An optional bool. Defaults to True. Whether to place the computation on the TPU.
device_assignment An optional list of ints. Defaults to []. The assignment of devices for the computation.
computation_shape An optional list of ints. Defaults to []. DEPRECATED. Use num_cores_per_replica instead.
host_compute_core An optional list of strings. Defaults to [].
padding_map An optional list of strings. Defaults to [].
step_marker_location An optional string. Defaults to "STEP_MARK_AT_ENTRY".
allow_soft_placement An optional bool. Defaults to False.
use_spmd_for_xla_partitioning An optional bool. Defaults to False.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.tpureplicatemetadata |
tf.raw_ops.Transpose Shuffle dimensions of x according to a permutation. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Transpose
tf.raw_ops.Transpose(
x, perm, name=None
)
The output y has the same rank as x. The shapes of x and y satisfy: y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]
Args
x A Tensor.
perm 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 x. | tensorflow.raw_ops.transpose |
tf.raw_ops.TridiagonalMatMul Calculate product with tridiagonal matrix. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TridiagonalMatMul
tf.raw_ops.TridiagonalMatMul(
superdiag, maindiag, subdiag, rhs, name=None
)
Calculates product of two matrices, where left matrix is a tridiagonal matrix.
Args
superdiag A Tensor. Must be one of the following types: float64, float32, complex64, complex128. Tensor of shape [..., 1, M], representing superdiagonals of tri-diagonal matrices to the left of multiplication. Last element is ignored.
maindiag A Tensor. Must have the same type as superdiag. Tensor of shape [..., 1, M], representing main diagonals of tri-diagonal matrices to the left of multiplication.
subdiag A Tensor. Must have the same type as superdiag. Tensor of shape [..., 1, M], representing subdiagonals of tri-diagonal matrices to the left of multiplication. First element is ignored.
rhs A Tensor. Must have the same type as superdiag. Tensor of shape [..., M, N], representing MxN matrices to the right of multiplication.
name A name for the operation (optional).
Returns A Tensor. Has the same type as superdiag. | tensorflow.raw_ops.tridiagonalmatmul |
tf.raw_ops.TridiagonalSolve Solves tridiagonal systems of equations. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TridiagonalSolve
tf.raw_ops.TridiagonalSolve(
diagonals, rhs, partial_pivoting=True, name=None
)
Solves tridiagonal systems of equations. Supports batch dimensions and multiple right-hand sides per each left-hand side. On CPU, solution is computed via Gaussian elimination with or without partial pivoting, depending on partial_pivoting attribute. On GPU, Nvidia's cuSPARSE library is used: https://docs.nvidia.com/cuda/cusparse/index.html#gtsv Partial pivoting is not yet supported by XLA backends.
Args
diagonals A Tensor. Must be one of the following types: float64, float32, complex64, complex128. Tensor of shape [..., 3, M] whose innermost 2 dimensions represent the tridiagonal matrices with three rows being the superdiagonal, diagonals, and subdiagonals, in order. The last element of the superdiagonal and the first element of the subdiagonal is ignored.
rhs A Tensor. Must have the same type as diagonals. Tensor of shape [..., M, K], representing K right-hand sides per each left-hand side.
partial_pivoting An optional bool. Defaults to True. Whether to apply partial pivoting. Partial pivoting makes the procedure more stable, but slower.
name A name for the operation (optional).
Returns A Tensor. Has the same type as diagonals. | tensorflow.raw_ops.tridiagonalsolve |
tf.raw_ops.TruncateDiv Returns x / y element-wise for integer types. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.TruncateDiv
tf.raw_ops.TruncateDiv(
x, y, name=None
)
Truncation designates that negative numbers will round fractional quantities toward zero. I.e. -7 / 5 = -1. This matches C semantics but it is different than Python semantics. See FloorDiv for a division function that matches Python Semantics.
Note: truncatediv supports broadcasting. More about broadcasting here
Args
x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, uint16, int16, int32, int64, complex64, complex128.
y A Tensor. Must have the same type as x.
name A name for the operation (optional).
Returns A Tensor. Has the same type as x. | tensorflow.raw_ops.truncatediv |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.