doc_content
stringlengths 1
386k
| doc_id
stringlengths 5
188
|
---|---|
tf.raw_ops.MapStage Stage (key, values) in the underlying container which behaves like a hashtable. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MapStage
tf.raw_ops.MapStage(
key, indices, values, dtypes, capacity=0, memory_limit=0,
container='', shared_name='', name=None
)
Args
key A Tensor of type int64. int64
indices A Tensor of type int32.
values A list of Tensor objects. a list of tensors dtypes A list of data types that inserted values should adhere to.
dtypes A list of tf.DTypes.
capacity An optional int that is >= 0. Defaults to 0. Maximum number of elements in the Staging Area. If > 0, inserts on the container will block when the capacity is reached.
memory_limit An optional int that is >= 0. Defaults to 0.
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 "". It is necessary to match this name to the matching Unstage Op.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.mapstage |
tf.raw_ops.MapUnstage Op removes and returns the values associated with the key View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MapUnstage
tf.raw_ops.MapUnstage(
key, indices, dtypes, capacity=0, memory_limit=0, container='',
shared_name='', name=None
)
from the underlying container. If the underlying container does not contain this key, the op will block until it does.
Args
key A Tensor of type int64.
indices A Tensor of type int32.
dtypes A list of tf.DTypes that has length >= 1.
capacity An optional int that is >= 0. Defaults to 0.
memory_limit An optional int that is >= 0. Defaults to 0.
container An optional string. Defaults to "".
shared_name An optional string. Defaults to "".
name A name for the operation (optional).
Returns A list of Tensor objects of type dtypes. | tensorflow.raw_ops.mapunstage |
tf.raw_ops.MapUnstageNoKey Op removes and returns a random (key, value) View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MapUnstageNoKey
tf.raw_ops.MapUnstageNoKey(
indices, dtypes, capacity=0, memory_limit=0, container='',
shared_name='', name=None
)
from the underlying container. If the underlying container does not contain elements, the op will block until it does.
Args
indices A Tensor of type int32.
dtypes A list of tf.DTypes that has length >= 1.
capacity An optional int that is >= 0. Defaults to 0.
memory_limit An optional int that is >= 0. Defaults to 0.
container An optional string. Defaults to "".
shared_name An optional string. Defaults to "".
name A name for the operation (optional).
Returns A tuple of Tensor objects (key, values). key A Tensor of type int64.
values A list of Tensor objects of type dtypes. | tensorflow.raw_ops.mapunstagenokey |
tf.raw_ops.MatchingFiles Returns the set of files matching one or more glob patterns. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatchingFiles
tf.raw_ops.MatchingFiles(
pattern, name=None
)
Note that this routine only supports wildcard characters in the basename portion of the pattern, not in the directory portion. Note also that the order of filenames returned is deterministic.
Args
pattern A Tensor of type string. Shell wildcard pattern(s). Scalar or vector of type string.
name A name for the operation (optional).
Returns A Tensor of type string. | tensorflow.raw_ops.matchingfiles |
tf.raw_ops.MatchingFilesDataset View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatchingFilesDataset
tf.raw_ops.MatchingFilesDataset(
patterns, name=None
)
Args
patterns A Tensor of type string.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.matchingfilesdataset |
tf.raw_ops.MatMul Multiply the matrix "a" by the matrix "b". View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatMul
tf.raw_ops.MatMul(
a, b, transpose_a=False, transpose_b=False, name=None
)
The inputs must be two-dimensional matrices and the inner dimension of "a" (after being transposed if transpose_a is true) must match the outer dimension of "b" (after being transposed if transposed_b is true).
Note: The default kernel implementation for MatMul on GPUs uses cublas.
Args
a A Tensor. Must be one of the following types: bfloat16, half, float32, float64, int32, int64, complex64, complex128.
b A Tensor. Must have the same type as a.
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.
name A name for the operation (optional).
Returns A Tensor. Has the same type as a. | tensorflow.raw_ops.matmul |
tf.raw_ops.MatrixBandPart Copy a tensor setting everything outside a central band in each innermost matrix to zero. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixBandPart
tf.raw_ops.MatrixBandPart(
input, num_lower, num_upper, name=None
)
The band part is computed as follows: Assume input has k dimensions [I, J, K, ..., M, N], then the output is a tensor with the same shape where band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]. The indicator function in_band(m, n) = (num_lower < 0 || (m-n) <= num_lower)) && (num_upper < 0 || (n-m) <= num_upper). For example: # if 'input' is [[ 0, 1, 2, 3]
[-1, 0, 1, 2]
[-2, -1, 0, 1]
[-3, -2, -1, 0]],
tf.matrix_band_part(input, 1, -1) ==> [[ 0, 1, 2, 3]
[-1, 0, 1, 2]
[ 0, -1, 0, 1]
[ 0, 0, -1, 0]],
tf.matrix_band_part(input, 2, 1) ==> [[ 0, 1, 0, 0]
[-1, 0, 1, 0]
[-2, -1, 0, 1]
[ 0, -2, -1, 0]]
Useful special cases: tf.matrix_band_part(input, 0, -1) ==> Upper triangular part.
tf.matrix_band_part(input, -1, 0) ==> Lower triangular part.
tf.matrix_band_part(input, 0, 0) ==> Diagonal.
Args
input A Tensor. Rank k tensor.
num_lower A Tensor. Must be one of the following types: int32, int64. 0-D tensor. Number of subdiagonals to keep. If negative, keep entire lower triangle.
num_upper A Tensor. Must have the same type as num_lower. 0-D tensor. Number of superdiagonals to keep. If negative, keep entire upper triangle.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixbandpart |
tf.raw_ops.MatrixDeterminant Computes the determinant of one or more square matrices. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixDeterminant
tf.raw_ops.MatrixDeterminant(
input, name=None
)
The input is a tensor of shape [..., M, M] whose inner-most 2 dimensions form square matrices. The output is a tensor containing the determinants for all input submatrices [..., :, :].
Args
input A Tensor. Must be one of the following types: half, float32, float64, complex64, complex128. Shape is [..., M, M].
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixdeterminant |
tf.raw_ops.MatrixDiag Returns a batched diagonal tensor with a given batched diagonal values. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixDiag
tf.raw_ops.MatrixDiag(
diagonal, name=None
)
Given a diagonal, this operation returns a tensor with the diagonal and everything else padded with zeros. The diagonal is computed as follows: Assume diagonal has k dimensions [I, J, K, ..., N], then the output is a tensor of rank k+1 with dimensions [I, J, K, ..., N, N]` where: output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]. For example: # 'diagonal' is [[1, 2, 3, 4], [5, 6, 7, 8]]
and diagonal.shape = (2, 4)
tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0]
[0, 2, 0, 0]
[0, 0, 3, 0]
[0, 0, 0, 4]],
[[5, 0, 0, 0]
[0, 6, 0, 0]
[0, 0, 7, 0]
[0, 0, 0, 8]]]
which has shape (2, 4, 4)
Args
diagonal A Tensor. Rank k, where k >= 1.
name A name for the operation (optional).
Returns A Tensor. Has the same type as diagonal. | tensorflow.raw_ops.matrixdiag |
tf.raw_ops.MatrixDiagPart Returns the batched diagonal part of a batched tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixDiagPart
tf.raw_ops.MatrixDiagPart(
input, name=None
)
This operation returns a tensor with the diagonal part of the batched input. The diagonal part is computed as follows: Assume input has k dimensions [I, J, K, ..., M, N], then the output is a tensor of rank k - 1 with dimensions [I, J, K, ..., min(M, N)] where: diagonal[i, j, k, ..., n] = input[i, j, k, ..., n, n]. The input must be at least a matrix. For example: # 'input' is [[[1, 0, 0, 0]
[0, 2, 0, 0]
[0, 0, 3, 0]
[0, 0, 0, 4]],
[[5, 0, 0, 0]
[0, 6, 0, 0]
[0, 0, 7, 0]
[0, 0, 0, 8]]]
and input.shape = (2, 4, 4)
tf.matrix_diag_part(input) ==> [[1, 2, 3, 4], [5, 6, 7, 8]]
which has shape (2, 4)
Args
input A Tensor. Rank k tensor where k >= 2.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixdiagpart |
tf.raw_ops.MatrixDiagPartV2 Returns the batched diagonal part of a batched tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixDiagPartV2
tf.raw_ops.MatrixDiagPartV2(
input, k, padding_value, name=None
)
Returns a tensor with the k[0]-th to k[1]-th diagonals of the batched input. Assume input has r dimensions [I, J, ..., L, M, N]. Let max_diag_len be the maximum length among all diagonals to be extracted, max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0)) Let num_diags be the number of diagonals to extract, num_diags = k[1] - k[0] + 1. If num_diags == 1, the output tensor is of rank r - 1 with shape [I, J, ..., L, max_diag_len] and values: diagonal[i, j, ..., l, n]
= input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
padding_value ; otherwise.
where y = max(-k[1], 0), x = max(k[1], 0). Otherwise, the output tensor has rank r with dimensions [I, J, ..., L, num_diags, max_diag_len] with values: diagonal[i, j, ..., l, m, n]
= input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
padding_value ; otherwise.
where d = k[1] - m, y = max(-d, 0), and x = max(d, 0). The input must be at least a matrix. For example: input = np.array([[[1, 2, 3, 4], # Input shape: (2, 3, 4)
[5, 6, 7, 8],
[9, 8, 7, 6]],
[[5, 4, 3, 2],
[1, 2, 3, 4],
[5, 6, 7, 8]]])
# A main diagonal from each batch.
tf.matrix_diag_part(input) ==> [[1, 6, 7], # Output shape: (2, 3)
[5, 2, 7]]
# A superdiagonal from each batch.
tf.matrix_diag_part(input, k = 1)
==> [[2, 7, 6], # Output shape: (2, 3)
[4, 3, 8]]
# A tridiagonal band from each batch.
tf.matrix_diag_part(input, k = (-1, 1))
==> [[[2, 7, 6], # Output shape: (2, 3, 3)
[1, 6, 7],
[5, 8, 0]],
[[4, 3, 8],
[5, 2, 7],
[1, 6, 0]]]
# Padding value = 9
tf.matrix_diag_part(input, k = (1, 3), padding_value = 9)
==> [[[4, 9, 9], # Output shape: (2, 3, 3)
[3, 8, 9],
[2, 7, 6]],
[[2, 9, 9],
[3, 4, 9],
[4, 3, 8]]]
Args
input A Tensor. Rank r tensor where r >= 2.
k A Tensor of type int32. Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. k can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. k[0] must not be larger than k[1].
padding_value A Tensor. Must have the same type as input. The value to fill the area outside the specified diagonal band with. Default is 0.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixdiagpartv2 |
tf.raw_ops.MatrixDiagPartV3 Returns the batched diagonal part of a batched tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixDiagPartV3
tf.raw_ops.MatrixDiagPartV3(
input, k, padding_value, align='RIGHT_LEFT', name=None
)
Returns a tensor with the k[0]-th to k[1]-th diagonals of the batched input. Assume input has r dimensions [I, J, ..., L, M, N]. Let max_diag_len be the maximum length among all diagonals to be extracted, max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0)) Let num_diags be the number of diagonals to extract, num_diags = k[1] - k[0] + 1. If num_diags == 1, the output tensor is of rank r - 1 with shape [I, J, ..., L, max_diag_len] and values: diagonal[i, j, ..., l, n]
= input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
padding_value ; otherwise.
where y = max(-k[1], 0), x = max(k[1], 0). Otherwise, the output tensor has rank r with dimensions [I, J, ..., L, num_diags, max_diag_len] with values: diagonal[i, j, ..., l, m, n]
= input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
padding_value ; otherwise.
where d = k[1] - m, y = max(-d, 0) - offset, and x = max(d, 0) - offset. offset is zero except when the alignment of the diagonal is to the right. offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
and `d >= 0`) or
(`align` in {LEFT_RIGHT, RIGHT_RIGHT}
and `d <= 0`)
0 ; otherwise
where diag_len(d) = min(cols - max(d, 0), rows + min(d, 0)). The input must be at least a matrix. For example: input = np.array([[[1, 2, 3, 4], # Input shape: (2, 3, 4)
[5, 6, 7, 8],
[9, 8, 7, 6]],
[[5, 4, 3, 2],
[1, 2, 3, 4],
[5, 6, 7, 8]]])
# A main diagonal from each batch.
tf.matrix_diag_part(input) ==> [[1, 6, 7], # Output shape: (2, 3)
[5, 2, 7]]
# A superdiagonal from each batch.
tf.matrix_diag_part(input, k = 1)
==> [[2, 7, 6], # Output shape: (2, 3)
[4, 3, 8]]
# A band from each batch.
tf.matrix_diag_part(input, k = (-1, 2))
==> [[[0, 3, 8], # Output shape: (2, 4, 3)
[2, 7, 6],
[1, 6, 7],
[5, 8, 0]],
[[0, 3, 4],
[4, 3, 8],
[5, 2, 7],
[1, 6, 0]]]
# LEFT_RIGHT alignment.
tf.matrix_diag_part(input, k = (-1, 2), align="LEFT_RIGHT")
==> [[[3, 8, 0], # Output shape: (2, 4, 3)
[2, 7, 6],
[1, 6, 7],
[0, 5, 8]],
[[3, 4, 0],
[4, 3, 8],
[5, 2, 7],
[0, 1, 6]]]
# max_diag_len can be shorter than the main diagonal.
tf.matrix_diag_part(input, k = (-2, -1))
==> [[[5, 8],
[9, 0]],
[[1, 6],
[5, 0]]]
# padding_value = 9
tf.matrix_diag_part(input, k = (1, 3), padding_value = 9)
==> [[[9, 9, 4], # Output shape: (2, 3, 3)
[9, 3, 8],
[2, 7, 6]],
[[9, 9, 2],
[9, 3, 4],
[4, 3, 8]]]
Args
input A Tensor. Rank r tensor where r >= 2.
k A Tensor of type int32. Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. k can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. k[0] must not be larger than k[1].
padding_value A Tensor. Must have the same type as input. The value to fill the area outside the specified diagonal band with. Default is 0.
align An optional string from: "LEFT_RIGHT", "RIGHT_LEFT", "LEFT_LEFT", "RIGHT_RIGHT". Defaults to "RIGHT_LEFT". Some diagonals are shorter than max_diag_len and need to be padded. align is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. There are four possible alignments: "RIGHT_LEFT" (default), "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is the opposite alignment.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixdiagpartv3 |
tf.raw_ops.MatrixDiagV2 Returns a batched diagonal tensor with given batched diagonal values. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixDiagV2
tf.raw_ops.MatrixDiagV2(
diagonal, k, num_rows, num_cols, padding_value, name=None
)
Returns a tensor with the contents in diagonal as k[0]-th to k[1]-th diagonals of a matrix, with everything else padded with padding. num_rows and num_cols specify the dimension of the innermost matrix of the output. If both are not specified, the op assumes the innermost matrix is square and infers its size from k and the innermost dimension of diagonal. If only one of them is specified, the op assumes the unspecified value is the smallest possible based on other criteria. Let diagonal have r dimensions [I, J, ..., L, M, N]. The output tensor has rank r+1 with shape [I, J, ..., L, M, num_rows, num_cols] when only one diagonal is given (k is an integer or k[0] == k[1]). Otherwise, it has rank r with shape [I, J, ..., L, num_rows, num_cols]. The second innermost dimension of diagonal has double meaning. When k is scalar or k[0] == k[1], M is part of the batch size [I, J, ..., M], and the output tensor is: output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper
padding_value ; otherwise
Otherwise, M is treated as the number of diagonals for the matrix in the same batch (M = k[1]-k[0]+1), and the output tensor is: output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
padding_value ; otherwise
where d = n - m, diag_index = k[1] - d, and index_in_diag = n - max(d, 0). For example: # The main diagonal.
diagonal = np.array([[1, 2, 3, 4], # Input shape: (2, 4)
[5, 6, 7, 8]])
tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0], # Output shape: (2, 4, 4)
[0, 2, 0, 0],
[0, 0, 3, 0],
[0, 0, 0, 4]],
[[5, 0, 0, 0],
[0, 6, 0, 0],
[0, 0, 7, 0],
[0, 0, 0, 8]]]
# A superdiagonal (per batch).
diagonal = np.array([[1, 2, 3], # Input shape: (2, 3)
[4, 5, 6]])
tf.matrix_diag(diagonal, k = 1)
==> [[[0, 1, 0, 0], # Output shape: (2, 4, 4)
[0, 0, 2, 0],
[0, 0, 0, 3],
[0, 0, 0, 0]],
[[0, 4, 0, 0],
[0, 0, 5, 0],
[0, 0, 0, 6],
[0, 0, 0, 0]]]
# A band of diagonals.
diagonals = np.array([[[1, 2, 3], # Input shape: (2, 2, 3)
[4, 5, 0]],
[[6, 7, 9],
[9, 1, 0]]])
tf.matrix_diag(diagonals, k = (-1, 0))
==> [[[1, 0, 0], # Output shape: (2, 3, 3)
[4, 2, 0],
[0, 5, 3]],
[[6, 0, 0],
[9, 7, 0],
[0, 1, 9]]]
# Rectangular matrix.
diagonal = np.array([1, 2]) # Input shape: (2)
tf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)
==> [[0, 0, 0, 0], # Output shape: (3, 4)
[1, 0, 0, 0],
[0, 2, 0, 0]]
# Rectangular matrix with inferred num_cols and padding_value = 9.
tf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)
==> [[9, 9], # Output shape: (3, 2)
[1, 9],
[9, 2]]
Args
diagonal A Tensor. Rank r, where r >= 1
k A Tensor of type int32. Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. k can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. k[0] must not be larger than k[1].
num_rows A Tensor of type int32. The number of rows of the output matrix. If it is not provided, the op assumes the output matrix is a square matrix and infers the matrix size from k and the innermost dimension of diagonal.
num_cols A Tensor of type int32. The number of columns of the output matrix. If it is not provided, the op assumes the output matrix is a square matrix and infers the matrix size from k and the innermost dimension of diagonal.
padding_value A Tensor. Must have the same type as diagonal. The number to fill the area outside the specified diagonal band with. Default is 0.
name A name for the operation (optional).
Returns A Tensor. Has the same type as diagonal. | tensorflow.raw_ops.matrixdiagv2 |
tf.raw_ops.MatrixDiagV3 Returns a batched diagonal tensor with given batched diagonal values. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixDiagV3
tf.raw_ops.MatrixDiagV3(
diagonal, k, num_rows, num_cols, padding_value, align='RIGHT_LEFT',
name=None
)
Returns a tensor with the contents in diagonal as k[0]-th to k[1]-th diagonals of a matrix, with everything else padded with padding. num_rows and num_cols specify the dimension of the innermost matrix of the output. If both are not specified, the op assumes the innermost matrix is square and infers its size from k and the innermost dimension of diagonal. If only one of them is specified, the op assumes the unspecified value is the smallest possible based on other criteria. Let diagonal have r dimensions [I, J, ..., L, M, N]. The output tensor has rank r+1 with shape [I, J, ..., L, M, num_rows, num_cols] when only one diagonal is given (k is an integer or k[0] == k[1]). Otherwise, it has rank r with shape [I, J, ..., L, num_rows, num_cols]. The second innermost dimension of diagonal has double meaning. When k is scalar or k[0] == k[1], M is part of the batch size [I, J, ..., M], and the output tensor is: output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper
padding_value ; otherwise
Otherwise, M is treated as the number of diagonals for the matrix in the same batch (M = k[1]-k[0]+1), and the output tensor is: output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
padding_value ; otherwise
where d = n - m, diag_index = [k] - d, and index_in_diag = n - max(d, 0) + offset. offset is zero except when the alignment of the diagonal is to the right. offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
and `d >= 0`) or
(`align` in {LEFT_RIGHT, RIGHT_RIGHT}
and `d <= 0`)
0 ; otherwise
where diag_len(d) = min(cols - max(d, 0), rows + min(d, 0)). For example: # The main diagonal.
diagonal = np.array([[1, 2, 3, 4], # Input shape: (2, 4)
[5, 6, 7, 8]])
tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0], # Output shape: (2, 4, 4)
[0, 2, 0, 0],
[0, 0, 3, 0],
[0, 0, 0, 4]],
[[5, 0, 0, 0],
[0, 6, 0, 0],
[0, 0, 7, 0],
[0, 0, 0, 8]]]
# A superdiagonal (per batch).
diagonal = np.array([[1, 2, 3], # Input shape: (2, 3)
[4, 5, 6]])
tf.matrix_diag(diagonal, k = 1)
==> [[[0, 1, 0, 0], # Output shape: (2, 4, 4)
[0, 0, 2, 0],
[0, 0, 0, 3],
[0, 0, 0, 0]],
[[0, 4, 0, 0],
[0, 0, 5, 0],
[0, 0, 0, 6],
[0, 0, 0, 0]]]
# A tridiagonal band (per batch).
diagonals = np.array([[[0, 8, 9], # Input shape: (2, 2, 3)
[1, 2, 3],
[4, 5, 0]],
[[0, 2, 3],
[6, 7, 9],
[9, 1, 0]]])
tf.matrix_diag(diagonals, k = (-1, 1))
==> [[[1, 8, 0], # Output shape: (2, 3, 3)
[4, 2, 9],
[0, 5, 3]],
[[6, 2, 0],
[9, 7, 3],
[0, 1, 9]]]
# LEFT_RIGHT alignment.
diagonals = np.array([[[8, 9, 0], # Input shape: (2, 2, 3)
[1, 2, 3],
[0, 4, 5]],
[[2, 3, 0],
[6, 7, 9],
[0, 9, 1]]])
tf.matrix_diag(diagonals, k = (-1, 1), align="LEFT_RIGHT")
==> [[[1, 8, 0], # Output shape: (2, 3, 3)
[4, 2, 9],
[0, 5, 3]],
[[6, 2, 0],
[9, 7, 3],
[0, 1, 9]]]
# Rectangular matrix.
diagonal = np.array([1, 2]) # Input shape: (2)
tf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)
==> [[0, 0, 0, 0], # Output shape: (3, 4)
[1, 0, 0, 0],
[0, 2, 0, 0]]
# Rectangular matrix with inferred num_cols and padding_value = 9.
tf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)
==> [[9, 9], # Output shape: (3, 2)
[1, 9],
[9, 2]]
Args
diagonal A Tensor. Rank r, where r >= 1
k A Tensor of type int32. Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. k can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. k[0] must not be larger than k[1].
num_rows A Tensor of type int32. The number of rows of the output matrix. If it is not provided, the op assumes the output matrix is a square matrix and infers the matrix size from k and the innermost dimension of diagonal.
num_cols A Tensor of type int32. The number of columns of the output matrix. If it is not provided, the op assumes the output matrix is a square matrix and infers the matrix size from k and the innermost dimension of diagonal.
padding_value A Tensor. Must have the same type as diagonal. The number to fill the area outside the specified diagonal band with. Default is 0.
align An optional string from: "LEFT_RIGHT", "RIGHT_LEFT", "LEFT_LEFT", "RIGHT_RIGHT". Defaults to "RIGHT_LEFT". Some diagonals are shorter than max_diag_len and need to be padded. align is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. There are four possible alignments: "RIGHT_LEFT" (default), "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is the opposite alignment.
name A name for the operation (optional).
Returns A Tensor. Has the same type as diagonal. | tensorflow.raw_ops.matrixdiagv3 |
tf.raw_ops.MatrixExponential Deprecated, use python implementation tf.linalg.matrix_exponential. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixExponential
tf.raw_ops.MatrixExponential(
input, name=None
)
Args
input A Tensor. Must be one of the following types: float64, float32, half, complex64, complex128.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixexponential |
tf.raw_ops.MatrixInverse Computes the inverse of one or more square invertible matrices or their adjoints (conjugate transposes). View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixInverse
tf.raw_ops.MatrixInverse(
input, adjoint=False, name=None
)
The input is a tensor of shape [..., M, M] whose inner-most 2 dimensions form square matrices. The output is a tensor of the same shape as the input containing the inverse for all input submatrices [..., :, :]. The op uses LU decomposition with partial pivoting to compute the inverses. If a matrix is not invertible there is no guarantee what the op does. It may detect the condition and raise an exception or it may simply return a garbage result.
Args
input A Tensor. Must be one of the following types: float64, float32, half, complex64, complex128. Shape is [..., M, M].
adjoint An optional bool. Defaults to False.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixinverse |
tf.raw_ops.MatrixLogarithm Computes the matrix logarithm of one or more square matrices: View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixLogarithm
tf.raw_ops.MatrixLogarithm(
input, name=None
)
\(log(exp(A)) = A\) This op is only defined for complex matrices. If A is positive-definite and real, then casting to a complex matrix, taking the logarithm and casting back to a real matrix will give the correct result. This function computes the matrix logarithm using the Schur-Parlett algorithm. Details of the algorithm can be found in Section 11.6.2 of: Nicholas J. Higham, Functions of Matrices: Theory and Computation, SIAM 2008. ISBN 978-0-898716-46-7. The input is a tensor of shape [..., M, M] whose inner-most 2 dimensions form square matrices. The output is a tensor of the same shape as the input containing the exponential for all input submatrices [..., :, :].
Args
input A Tensor. Must be one of the following types: complex64, complex128. Shape is [..., M, M].
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixlogarithm |
tf.raw_ops.MatrixSetDiag Returns a batched matrix tensor with new batched diagonal values. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixSetDiag
tf.raw_ops.MatrixSetDiag(
input, diagonal, name=None
)
Given input and diagonal, this operation returns a tensor with the same shape and values as input, except for the main diagonal of the innermost matrices. These will be overwritten by the values in diagonal. The output is computed as follows: Assume input has k+1 dimensions [I, J, K, ..., M, N] and diagonal has k dimensions [I, J, K, ..., min(M, N)]. Then the output is a tensor of rank k+1 with dimensions [I, J, K, ..., M, N] where:
output[i, j, k, ..., m, n] = diagonal[i, j, k, ..., n] for m == n.
output[i, j, k, ..., m, n] = input[i, j, k, ..., m, n] for m != n.
Args
input A Tensor. Rank k+1, where k >= 1.
diagonal A Tensor. Must have the same type as input. Rank k, where k >= 1.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixsetdiag |
tf.raw_ops.MatrixSetDiagV2 Returns a batched matrix tensor with new batched diagonal values. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixSetDiagV2
tf.raw_ops.MatrixSetDiagV2(
input, diagonal, k, name=None
)
Given input and diagonal, this operation returns a tensor with the same shape and values as input, except for the specified diagonals of the innermost matrices. These will be overwritten by the values in diagonal. input has r+1 dimensions [I, J, ..., L, M, N]. When k is scalar or k[0] == k[1], diagonal has r dimensions [I, J, ..., L, max_diag_len]. Otherwise, it has r+1 dimensions [I, J, ..., L, num_diags, max_diag_len]. num_diags is the number of diagonals, num_diags = k[1] - k[0] + 1. max_diag_len is the longest diagonal in the range [k[0], k[1]], max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0)) The output is a tensor of rank k+1 with dimensions [I, J, ..., L, M, N]. If k is scalar or k[0] == k[1]: output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]
input[i, j, ..., l, m, n] ; otherwise
Otherwise, output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
input[i, j, ..., l, m, n] ; otherwise
where d = n - m, diag_index = k[1] - d, and index_in_diag = n - max(d, 0). For example: # The main diagonal.
input = np.array([[[7, 7, 7, 7], # Input shape: (2, 3, 4)
[7, 7, 7, 7],
[7, 7, 7, 7]],
[[7, 7, 7, 7],
[7, 7, 7, 7],
[7, 7, 7, 7]]])
diagonal = np.array([[1, 2, 3], # Diagonal shape: (2, 3)
[4, 5, 6]])
tf.matrix_set_diag(diagonal) ==> [[[1, 7, 7, 7], # Output shape: (2, 3, 4)
[7, 2, 7, 7],
[7, 7, 3, 7]],
[[4, 7, 7, 7],
[7, 5, 7, 7],
[7, 7, 6, 7]]]
# A superdiagonal (per batch).
tf.matrix_set_diag(diagonal, k = 1)
==> [[[7, 1, 7, 7], # Output shape: (2, 3, 4)
[7, 7, 2, 7],
[7, 7, 7, 3]],
[[7, 4, 7, 7],
[7, 7, 5, 7],
[7, 7, 7, 6]]]
# A band of diagonals.
diagonals = np.array([[[1, 2, 3], # Diagonal shape: (2, 2, 3)
[4, 5, 0]],
[[6, 1, 2],
[3, 4, 0]]])
tf.matrix_set_diag(diagonals, k = (-1, 0))
==> [[[1, 7, 7, 7], # Output shape: (2, 3, 4)
[4, 2, 7, 7],
[0, 5, 3, 7]],
[[6, 7, 7, 7],
[3, 1, 7, 7],
[7, 4, 2, 7]]]
Args
input A Tensor. Rank r+1, where r >= 1.
diagonal A Tensor. Must have the same type as input. Rank r when k is an integer or k[0] == k[1]. Otherwise, it has rank r+1. k >= 1.
k A Tensor of type int32. Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. k can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. k[0] must not be larger than k[1].
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixsetdiagv2 |
tf.raw_ops.MatrixSetDiagV3 Returns a batched matrix tensor with new batched diagonal values. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixSetDiagV3
tf.raw_ops.MatrixSetDiagV3(
input, diagonal, k, align='RIGHT_LEFT', name=None
)
Given input and diagonal, this operation returns a tensor with the same shape and values as input, except for the specified diagonals of the innermost matrices. These will be overwritten by the values in diagonal. input has r+1 dimensions [I, J, ..., L, M, N]. When k is scalar or k[0] == k[1], diagonal has r dimensions [I, J, ..., L, max_diag_len]. Otherwise, it has r+1 dimensions [I, J, ..., L, num_diags, max_diag_len]. num_diags is the number of diagonals, num_diags = k[1] - k[0] + 1. max_diag_len is the longest diagonal in the range [k[0], k[1]], max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0)) The output is a tensor of rank k+1 with dimensions [I, J, ..., L, M, N]. If k is scalar or k[0] == k[1]: output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]
input[i, j, ..., l, m, n] ; otherwise
Otherwise, output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
input[i, j, ..., l, m, n] ; otherwise
where d = n - m, diag_index = k[1] - d, and index_in_diag = n - max(d, 0) + offset. offset is zero except when the alignment of the diagonal is to the right. offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
and `d >= 0`) or
(`align` in {LEFT_RIGHT, RIGHT_RIGHT}
and `d <= 0`)
0 ; otherwise
where diag_len(d) = min(cols - max(d, 0), rows + min(d, 0)). For example: # The main diagonal.
input = np.array([[[7, 7, 7, 7], # Input shape: (2, 3, 4)
[7, 7, 7, 7],
[7, 7, 7, 7]],
[[7, 7, 7, 7],
[7, 7, 7, 7],
[7, 7, 7, 7]]])
diagonal = np.array([[1, 2, 3], # Diagonal shape: (2, 3)
[4, 5, 6]])
tf.matrix_set_diag(input, diagonal)
==> [[[1, 7, 7, 7], # Output shape: (2, 3, 4)
[7, 2, 7, 7],
[7, 7, 3, 7]],
[[4, 7, 7, 7],
[7, 5, 7, 7],
[7, 7, 6, 7]]]
# A superdiagonal (per batch).
tf.matrix_set_diag(input, diagonal, k = 1)
==> [[[7, 1, 7, 7], # Output shape: (2, 3, 4)
[7, 7, 2, 7],
[7, 7, 7, 3]],
[[7, 4, 7, 7],
[7, 7, 5, 7],
[7, 7, 7, 6]]]
# A band of diagonals.
diagonals = np.array([[[0, 9, 1], # Diagonal shape: (2, 4, 3)
[6, 5, 8],
[1, 2, 3],
[4, 5, 0]],
[[0, 1, 2],
[5, 6, 4],
[6, 1, 2],
[3, 4, 0]]])
tf.matrix_set_diag(input, diagonals, k = (-1, 2))
==> [[[1, 6, 9, 7], # Output shape: (2, 3, 4)
[4, 2, 5, 1],
[7, 5, 3, 8]],
[[6, 5, 1, 7],
[3, 1, 6, 2],
[7, 4, 2, 4]]]
# LEFT_RIGHT alignment.
diagonals = np.array([[[9, 1, 0], # Diagonal shape: (2, 4, 3)
[6, 5, 8],
[1, 2, 3],
[0, 4, 5]],
[[1, 2, 0],
[5, 6, 4],
[6, 1, 2],
[0, 3, 4]]])
tf.matrix_set_diag(input, diagonals, k = (-1, 2), align="LEFT_RIGHT")
==> [[[1, 6, 9, 7], # Output shape: (2, 3, 4)
[4, 2, 5, 1],
[7, 5, 3, 8]],
[[6, 5, 1, 7],
[3, 1, 6, 2],
[7, 4, 2, 4]]]
Args
input A Tensor. Rank r+1, where r >= 1.
diagonal A Tensor. Must have the same type as input. Rank r when k is an integer or k[0] == k[1]. Otherwise, it has rank r+1. k >= 1.
k A Tensor of type int32. Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. k can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. k[0] must not be larger than k[1].
align An optional string from: "LEFT_RIGHT", "RIGHT_LEFT", "LEFT_LEFT", "RIGHT_RIGHT". Defaults to "RIGHT_LEFT". Some diagonals are shorter than max_diag_len and need to be padded. align is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. There are four possible alignments: "RIGHT_LEFT" (default), "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is the opposite alignment.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixsetdiagv3 |
tf.raw_ops.MatrixSolve Solves systems of linear equations. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixSolve
tf.raw_ops.MatrixSolve(
matrix, rhs, adjoint=False, name=None
)
Matrix is a tensor of shape [..., M, M] whose inner-most 2 dimensions form square matrices. Rhs is a tensor of shape [..., M, K]. The output is a tensor shape [..., M, K]. If adjoint is False then each output matrix satisfies matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]. If adjoint is True then each output matrix satisfies adjoint(matrix[..., :, :]) * output[..., :, :] = rhs[..., :, :].
Args
matrix A Tensor. Must be one of the following types: float64, float32, half, complex64, complex128. Shape is [..., M, M].
rhs A Tensor. Must have the same type as matrix. Shape is [..., M, K].
adjoint An optional bool. Defaults to False. Boolean indicating whether to solve with matrix or its (block-wise) adjoint.
name A name for the operation (optional).
Returns A Tensor. Has the same type as matrix. | tensorflow.raw_ops.matrixsolve |
tf.raw_ops.MatrixSolveLs Solves one or more linear least-squares problems. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixSolveLs
tf.raw_ops.MatrixSolveLs(
matrix, rhs, l2_regularizer, fast=True, name=None
)
matrix is a tensor of shape [..., M, N] whose inner-most 2 dimensions form real or complex matrices of size [M, N]. Rhs is a tensor of the same type as matrix and shape [..., M, K]. The output is a tensor shape [..., N, K] where each output matrix solves each of the equations matrix[..., :, :] * output[..., :, :] = rhs[..., :, :] in the least squares sense. We use the following notation for (complex) matrix and right-hand sides in the batch: matrix=\(A \in \mathbb{C}^{m \times n}\), rhs=\(B \in \mathbb{C}^{m \times k}\), output=\(X \in \mathbb{C}^{n \times k}\), l2_regularizer=\(\lambda \in \mathbb{R}\). If fast is True, then the solution is computed by solving the normal equations using Cholesky decomposition. Specifically, if \(m \ge n\) then \(X = (A^H A + \lambda I)^{-1} A^H B\), which solves the least-squares problem \(X = \mathrm{argmin}_{Z \in \Re^{n \times k} } ||A Z - B||_F^2 + \lambda ||Z||_F^2\). If \(m \lt n\) then output is computed as \(X = A^H (A A^H + \lambda I)^{-1} B\), which (for \(\lambda = 0\)) is the minimum-norm solution to the under-determined linear system, i.e. \(X = \mathrm{argmin}_{Z \in \mathbb{C}^{n \times k} } ||Z||_F^2 \), subject to \(A Z = B\). Notice that the fast path is only numerically stable when \(A\) is numerically full rank and has a condition number \(\mathrm{cond}(A) \lt \frac{1}{\sqrt{\epsilon_{mach} } }\) or \(\lambda\) is sufficiently large. If fast is False an algorithm based on the numerically robust complete orthogonal decomposition is used. This computes the minimum-norm least-squares solution, even when \(A\) is rank deficient. This path is typically 6-7 times slower than the fast path. If fast is False then l2_regularizer is ignored.
Args
matrix A Tensor. Must be one of the following types: float64, float32, half, complex64, complex128. Shape is [..., M, N].
rhs A Tensor. Must have the same type as matrix. Shape is [..., M, K].
l2_regularizer A Tensor of type float64. Scalar tensor.
fast An optional bool. Defaults to True.
name A name for the operation (optional).
Returns A Tensor. Has the same type as matrix.
Numpy Compatibility Equivalent to np.linalg.lstsq | tensorflow.raw_ops.matrixsolvels |
tf.raw_ops.MatrixSquareRoot Computes the matrix square root of one or more square matrices: View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixSquareRoot
tf.raw_ops.MatrixSquareRoot(
input, name=None
)
matmul(sqrtm(A), sqrtm(A)) = A The input matrix should be invertible. If the input matrix is real, it should have no eigenvalues which are real and negative (pairs of complex conjugate eigenvalues are allowed). The matrix square root is computed by first reducing the matrix to quasi-triangular form with the real Schur decomposition. The square root of the quasi-triangular matrix is then computed directly. Details of the algorithm can be found in: Nicholas J. Higham, "Computing real square roots of a real matrix", Linear Algebra Appl., 1987. The input is a tensor of shape [..., M, M] whose inner-most 2 dimensions form square matrices. The output is a tensor of the same shape as the input containing the matrix square root for all input submatrices [..., :, :].
Args
input A Tensor. Must be one of the following types: float64, float32, half, complex64, complex128. Shape is [..., M, M].
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.matrixsquareroot |
tf.raw_ops.MatrixTriangularSolve Solves systems of linear equations with upper or lower triangular matrices by backsubstitution. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MatrixTriangularSolve
tf.raw_ops.MatrixTriangularSolve(
matrix, rhs, lower=True, adjoint=False, name=None
)
matrix is a tensor of shape [..., M, M] whose inner-most 2 dimensions form square matrices. If lower is True then the strictly upper triangular part of each inner-most matrix is assumed to be zero and not accessed. If lower is False then the strictly lower triangular part of each inner-most matrix is assumed to be zero and not accessed. rhs is a tensor of shape [..., M, N]. The output is a tensor of shape [..., M, N]. If adjoint is True then the innermost matrices in output satisfy matrix equations matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]. If adjoint is False then the strictly then the innermost matrices in output satisfy matrix equations adjoint(matrix[..., i, k]) * output[..., k, j] = rhs[..., i, j]. Note, the batch shapes for the inputs only need to broadcast. Example:
a = tf.constant([[3, 0, 0, 0],
[2, 1, 0, 0],
[1, 0, 1, 0],
[1, 1, 1, 1]], dtype=tf.float32)
b = tf.constant([[4],
[2],
[4],
[2]], dtype=tf.float32)
x = tf.linalg.triangular_solve(a, b, lower=True)
x
# <tf.Tensor: shape=(4, 1), dtype=float32, numpy=
# array([[ 1.3333334 ],
# [-0.66666675],
# [ 2.6666665 ],
# [-1.3333331 ]], dtype=float32)>
# in python3 one can use `a@x`
tf.matmul(a, x)
# <tf.Tensor: shape=(4, 1), dtype=float32, numpy=
# array([[4. ],
# [2. ],
# [4. ],
# [1.9999999]], dtype=float32)>
Args
matrix A Tensor. Must be one of the following types: float64, float32, half, complex64, complex128. Shape is [..., M, M].
rhs A Tensor. Must have the same type as matrix. Shape is [..., M, K].
lower An optional bool. Defaults to True. Boolean indicating whether the innermost matrices in matrix are lower or upper triangular.
adjoint An optional bool. Defaults to False. Boolean indicating whether to solve with matrix or its (block-wise) adjoint.
name A name for the operation (optional).
Returns A Tensor. Has the same type as matrix.
Numpy Compatibility Equivalent to scipy.linalg.solve_triangular | tensorflow.raw_ops.matrixtriangularsolve |
tf.raw_ops.Max Computes the maximum of elements across dimensions of a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Max
tf.raw_ops.Max(
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, int64, bfloat16, uint16, half, uint32, uint64, qint8, quint8, qint32, qint16, quint16. 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.max |
tf.raw_ops.Maximum Returns the max of x and y (i.e. x > y ? x : y) element-wise. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Maximum
tf.raw_ops.Maximum(
x, y, name=None
)
Example:
x = tf.constant([0., 0., 0., 0.])
y = tf.constant([-2., 0., 2., 5.])
tf.math.maximum(x, y)
<tf.Tensor: shape=(4,), dtype=float32, numpy=array([0., 0., 2., 5.], dtype=float32)>
Args
x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int16, int32, int64.
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.maximum |
tf.raw_ops.MaxIntraOpParallelismDataset Creates a dataset that overrides the maximum intra-op parallelism. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxIntraOpParallelismDataset
tf.raw_ops.MaxIntraOpParallelismDataset(
input_dataset, max_intra_op_parallelism, output_types, output_shapes, name=None
)
Args
input_dataset A Tensor of type variant.
max_intra_op_parallelism A Tensor of type int64. Identifies the maximum intra-op parallelism to use.
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.maxintraopparallelismdataset |
tf.raw_ops.MaxPool Performs max pooling on the input. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPool
tf.raw_ops.MaxPool(
input, ksize, strides, padding, explicit_paddings=[],
data_format='NHWC', name=None
)
Args
input A Tensor. Must be one of the following types: half, bfloat16, float32, float64, int32, int64, uint8, int16, int8, uint16, qint8. 4-D input to pool over.
ksize A list of ints that has length >= 4. The size of the window for each dimension of the input tensor.
strides A list of ints that has length >= 4. The stride of the sliding window for each dimension of the input tensor.
padding A string from: "SAME", "VALID", "EXPLICIT". The type of padding algorithm to use.
explicit_paddings An optional list of ints. Defaults to [].
data_format An optional string from: "NHWC", "NCHW", "NCHW_VECT_C". Defaults to "NHWC". Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in_height, in_width, in_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in_channels, in_height, in_width].
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.maxpool |
tf.raw_ops.MaxPool3D Performs 3D max pooling on the input. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPool3D
tf.raw_ops.MaxPool3D(
input, ksize, strides, padding, data_format='NDHWC', name=None
)
Args
input A Tensor. Must be one of the following types: half, bfloat16, float32. Shape [batch, depth, rows, cols, channels] tensor to pool over.
ksize A list of ints that has length >= 5. 1-D tensor of length 5. The size of the window for each dimension of the input tensor. Must have ksize[0] = ksize[4] = 1.
strides A list of ints that has length >= 5. 1-D tensor of length 5. The stride of the sliding window for each dimension of input. Must have strides[0] = strides[4] = 1.
padding A string from: "SAME", "VALID". The type of padding algorithm to use.
data_format An optional string from: "NDHWC", "NCDHW". Defaults to "NDHWC". The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in_depth, in_height, in_width, in_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in_channels, in_depth, in_height, in_width].
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.maxpool3d |
tf.raw_ops.MaxPool3DGrad Computes gradients of 3D max pooling function. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPool3DGrad
tf.raw_ops.MaxPool3DGrad(
orig_input, orig_output, grad, ksize, strides, padding,
data_format='NDHWC', name=None
)
Args
orig_input A Tensor. Must be one of the following types: half, bfloat16, float32. The original input tensor.
orig_output A Tensor. Must have the same type as orig_input. The original output tensor.
grad A Tensor. Must be one of the following types: half, bfloat16, float32. Output backprop of shape [batch, depth, rows, cols, channels].
ksize A list of ints that has length >= 5. 1-D tensor of length 5. The size of the window for each dimension of the input tensor. Must have ksize[0] = ksize[4] = 1.
strides A list of ints that has length >= 5. 1-D tensor of length 5. The stride of the sliding window for each dimension of input. Must have strides[0] = strides[4] = 1.
padding A string from: "SAME", "VALID". The type of padding algorithm to use.
data_format An optional string from: "NDHWC", "NCDHW". Defaults to "NDHWC". The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in_depth, in_height, in_width, in_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in_channels, in_depth, in_height, in_width].
name A name for the operation (optional).
Returns A Tensor. Has the same type as grad. | tensorflow.raw_ops.maxpool3dgrad |
tf.raw_ops.MaxPool3DGradGrad Computes second-order gradients of the maxpooling function. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPool3DGradGrad
tf.raw_ops.MaxPool3DGradGrad(
orig_input, orig_output, grad, ksize, strides, padding,
data_format='NDHWC', name=None
)
Args
orig_input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. The original input tensor.
orig_output A Tensor. Must have the same type as orig_input. The original output tensor.
grad A Tensor. Must have the same type as orig_input. Output backprop of shape [batch, depth, rows, cols, channels].
ksize A list of ints that has length >= 5. 1-D tensor of length 5. The size of the window for each dimension of the input tensor. Must have ksize[0] = ksize[4] = 1.
strides A list of ints that has length >= 5. 1-D tensor of length 5. The stride of the sliding window for each dimension of input. Must have strides[0] = strides[4] = 1.
padding A string from: "SAME", "VALID". The type of padding algorithm to use.
data_format An optional string from: "NDHWC", "NCDHW". Defaults to "NDHWC". The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in_depth, in_height, in_width, in_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in_channels, in_depth, in_height, in_width].
name A name for the operation (optional).
Returns A Tensor. Has the same type as orig_input. | tensorflow.raw_ops.maxpool3dgradgrad |
tf.raw_ops.MaxPoolGrad Computes gradients of the maxpooling function. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPoolGrad
tf.raw_ops.MaxPoolGrad(
orig_input, orig_output, grad, ksize, strides, padding, explicit_paddings=[],
data_format='NHWC', name=None
)
Args
orig_input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. The original input tensor.
orig_output A Tensor. Must have the same type as orig_input. The original output tensor.
grad A Tensor. Must have the same type as orig_input. 4-D. Gradients w.r.t. the output of max_pool.
ksize A list of ints that has length >= 4. The size of the window for each dimension of the input tensor.
strides A list of ints that has length >= 4. The stride of the sliding window for each dimension of the input tensor.
padding A string from: "SAME", "VALID", "EXPLICIT". The type of padding algorithm to use.
explicit_paddings An optional list of ints. Defaults to [].
data_format An optional string from: "NHWC", "NCHW". Defaults to "NHWC". Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in_height, in_width, in_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in_channels, in_height, in_width].
name A name for the operation (optional).
Returns A Tensor. Has the same type as orig_input. | tensorflow.raw_ops.maxpoolgrad |
tf.raw_ops.MaxPoolGradGrad Computes second-order gradients of the maxpooling function. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPoolGradGrad
tf.raw_ops.MaxPoolGradGrad(
orig_input, orig_output, grad, ksize, strides, padding,
data_format='NHWC', name=None
)
Args
orig_input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. The original input tensor.
orig_output A Tensor. Must have the same type as orig_input. The original output tensor.
grad A Tensor. Must have the same type as orig_input. 4-D. Gradients of gradients w.r.t. the input of max_pool.
ksize A list of ints that has length >= 4. The size of the window for each dimension of the input tensor.
strides A list of ints that has length >= 4. 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.
data_format An optional string from: "NHWC", "NCHW". Defaults to "NHWC". Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in_height, in_width, in_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in_channels, in_height, in_width].
name A name for the operation (optional).
Returns A Tensor. Has the same type as orig_input. | tensorflow.raw_ops.maxpoolgradgrad |
tf.raw_ops.MaxPoolGradGradV2 Computes second-order gradients of the maxpooling function. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPoolGradGradV2
tf.raw_ops.MaxPoolGradGradV2(
orig_input, orig_output, grad, ksize, strides, padding,
data_format='NHWC', name=None
)
Args
orig_input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. The original input tensor.
orig_output A Tensor. Must have the same type as orig_input. The original output tensor.
grad A Tensor. Must have the same type as orig_input. 4-D. Gradients of gradients w.r.t. the input of max_pool.
ksize A Tensor of type int32. The size of the window for each dimension of the input tensor.
strides A Tensor of type int32. 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.
data_format An optional string from: "NHWC", "NCHW". Defaults to "NHWC". Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in_height, in_width, in_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in_channels, in_height, in_width].
name A name for the operation (optional).
Returns A Tensor. Has the same type as orig_input. | tensorflow.raw_ops.maxpoolgradgradv2 |
tf.raw_ops.MaxPoolGradGradWithArgmax Computes second-order gradients of the maxpooling function. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPoolGradGradWithArgmax
tf.raw_ops.MaxPoolGradGradWithArgmax(
input, grad, argmax, ksize, strides, padding, include_batch_in_index=False,
name=None
)
Args
input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. The original input.
grad A Tensor. Must have the same type as input. 4-D with shape [batch, height, width, channels]. Gradients w.r.t. the input of max_pool.
argmax A Tensor. Must be one of the following types: int32, int64. The indices of the maximum values chosen for each output of max_pool.
ksize A list of ints that has length >= 4. The size of the window for each dimension of the input tensor.
strides A list of ints that has length >= 4. 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.
include_batch_in_index An optional bool. Defaults to False. Whether to include batch dimension in flattened index of argmax.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.maxpoolgradgradwithargmax |
tf.raw_ops.MaxPoolGradV2 Computes gradients of the maxpooling function. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPoolGradV2
tf.raw_ops.MaxPoolGradV2(
orig_input, orig_output, grad, ksize, strides, padding,
data_format='NHWC', name=None
)
Args
orig_input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. The original input tensor.
orig_output A Tensor. Must have the same type as orig_input. The original output tensor.
grad A Tensor. Must have the same type as orig_input. 4-D. Gradients w.r.t. the output of max_pool.
ksize A Tensor of type int32. The size of the window for each dimension of the input tensor.
strides A Tensor of type int32. 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.
data_format An optional string from: "NHWC", "NCHW". Defaults to "NHWC". Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in_height, in_width, in_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in_channels, in_height, in_width].
name A name for the operation (optional).
Returns A Tensor. Has the same type as orig_input. | tensorflow.raw_ops.maxpoolgradv2 |
tf.raw_ops.MaxPoolGradWithArgmax Computes gradients of the maxpooling function. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPoolGradWithArgmax
tf.raw_ops.MaxPoolGradWithArgmax(
input, grad, argmax, ksize, strides, padding, include_batch_in_index=False,
name=None
)
Args
input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. The original input.
grad A Tensor. Must have the same type as input. 4-D with shape [batch, height, width, channels]. Gradients w.r.t. the output of max_pool.
argmax A Tensor. Must be one of the following types: int32, int64. The indices of the maximum values chosen for each output of max_pool.
ksize A list of ints that has length >= 4. The size of the window for each dimension of the input tensor.
strides A list of ints that has length >= 4. 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.
include_batch_in_index An optional bool. Defaults to False. Whether to include batch dimension in flattened index of argmax.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.maxpoolgradwithargmax |
tf.raw_ops.MaxPoolV2 Performs max pooling on the input. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPoolV2
tf.raw_ops.MaxPoolV2(
input, ksize, strides, padding, data_format='NHWC', name=None
)
Args
input A Tensor. Must be one of the following types: half, bfloat16, float32, float64, int32, int64, uint8, int16, int8, uint16, qint8. 4-D input to pool over.
ksize A Tensor of type int32. The size of the window for each dimension of the input tensor.
strides A Tensor of type int32. 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.
data_format An optional string from: "NHWC", "NCHW", "NCHW_VECT_C". Defaults to "NHWC". Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in_height, in_width, in_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in_channels, in_height, in_width].
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.maxpoolv2 |
tf.raw_ops.MaxPoolWithArgmax Performs max pooling on the input and outputs both max values and indices. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MaxPoolWithArgmax
tf.raw_ops.MaxPoolWithArgmax(
input, ksize, strides, padding, Targmax=tf.dtypes.int64,
include_batch_in_index=False, name=None
)
The indices in argmax are flattened, so that a maximum value at position [b, y, x, c] becomes flattened index: (y * width + x) * channels + c if include_batch_in_index is False; ((b * height + y) * width + x) * channels + c if include_batch_in_index is True. The indices returned are always in [0, height) x [0, width) before flattening, even if padding is involved and the mathematically correct answer is outside (either negative or too large). This is a bug, but fixing it is difficult to do in a safe backwards compatible way, especially due to flattening.
Args
input A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. 4-D with shape [batch, height, width, channels]. Input to pool over.
ksize A list of ints that has length >= 4. The size of the window for each dimension of the input tensor.
strides A list of ints that has length >= 4. 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.
Targmax An optional tf.DType from: tf.int32, tf.int64. Defaults to tf.int64.
include_batch_in_index An optional bool. Defaults to False. Whether to include batch dimension in flattened index of argmax.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, argmax). output A Tensor. Has the same type as input.
argmax A Tensor of type Targmax. | tensorflow.raw_ops.maxpoolwithargmax |
tf.raw_ops.Mean Computes the mean of elements across dimensions of a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Mean
tf.raw_ops.Mean(
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.mean |
tf.raw_ops.Merge Forwards the value of an available tensor from inputs to output. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Merge
tf.raw_ops.Merge(
inputs, name=None
)
Merge waits for at least one of the tensors in inputs to become available. It is usually combined with Switch to implement branching. Merge forwards the first tensor to become available to output, and sets value_index to its index in inputs.
Args
inputs A list of at least 1 Tensor objects with the same type. The input tensors, exactly one of which will become available.
name A name for the operation (optional).
Returns A tuple of Tensor objects (output, value_index). output A Tensor. Has the same type as inputs.
value_index A Tensor of type int32. | tensorflow.raw_ops.merge |
tf.raw_ops.MergeSummary Merges summaries. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MergeSummary
tf.raw_ops.MergeSummary(
inputs, name=None
)
This op creates a Summary protocol buffer that contains the union of all the values in the input summaries. When the Op is run, it reports an InvalidArgument error if multiple values in the summaries to merge use the same tag.
Args
inputs A list of at least 1 Tensor objects with type string. Can be of any shape. Each must contain serialized Summary protocol buffers.
name A name for the operation (optional).
Returns A Tensor of type string. | tensorflow.raw_ops.mergesummary |
tf.raw_ops.MergeV2Checkpoints V2 format specific: merges the metadata files of sharded checkpoints. The View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MergeV2Checkpoints
tf.raw_ops.MergeV2Checkpoints(
checkpoint_prefixes, destination_prefix, delete_old_dirs=True, name=None
)
result is one logical checkpoint, with one physical metadata file and renamed data files. Intended for "grouping" multiple checkpoints in a sharded checkpoint setup. If delete_old_dirs is true, attempts to delete recursively the dirname of each path in the input checkpoint_prefixes. This is useful when those paths are non user-facing temporary locations.
Args
checkpoint_prefixes A Tensor of type string. prefixes of V2 checkpoints to merge.
destination_prefix A Tensor of type string. scalar. The desired final prefix. Allowed to be the same as one of the checkpoint_prefixes.
delete_old_dirs An optional bool. Defaults to True. see above.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.mergev2checkpoints |
tf.raw_ops.Mfcc Transforms a spectrogram into a form that's useful for speech recognition. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Mfcc
tf.raw_ops.Mfcc(
spectrogram, sample_rate, upper_frequency_limit=4000, lower_frequency_limit=20,
filterbank_channel_count=40, dct_coefficient_count=13, name=None
)
Mel Frequency Cepstral Coefficients are a way of representing audio data that's been effective as an input feature for machine learning. They are created by taking the spectrum of a spectrogram (a 'cepstrum'), and discarding some of the higher frequencies that are less significant to the human ear. They have a long history in the speech recognition world, and https://en.wikipedia.org/wiki/Mel-frequency_cepstrum is a good resource to learn more.
Args
spectrogram A Tensor of type float32. Typically produced by the Spectrogram op, with magnitude_squared set to true.
sample_rate A Tensor of type int32. How many samples per second the source audio used.
upper_frequency_limit An optional float. Defaults to 4000. The highest frequency to use when calculating the ceptstrum.
lower_frequency_limit An optional float. Defaults to 20. The lowest frequency to use when calculating the ceptstrum.
filterbank_channel_count An optional int. Defaults to 40. Resolution of the Mel bank used internally.
dct_coefficient_count An optional int. Defaults to 13. How many output channels to produce per time slice.
name A name for the operation (optional).
Returns A Tensor of type float32. | tensorflow.raw_ops.mfcc |
tf.raw_ops.Min Computes the minimum of elements across dimensions of a tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Min
tf.raw_ops.Min(
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, int64, bfloat16, uint16, half, uint32, uint64, qint8, quint8, qint32, qint16, quint16. 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.min |
tf.raw_ops.Minimum Returns the min of x and y (i.e. x < y ? x : y) element-wise. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Minimum
tf.raw_ops.Minimum(
x, y, name=None
)
Both inputs are number-type tensors (except complex). minimum expects that both tensors have the same dtype. Examples:
x = tf.constant([0., 0., 0., 0.])
y = tf.constant([-5., -2., 0., 3.])
tf.math.minimum(x, y)
<tf.Tensor: shape=(4,), dtype=float32, numpy=array([-5., -2., 0., 0.], dtype=float32)>
Note that minimum supports broadcast semantics.
x = tf.constant([-5., 0., 0., 0.])
y = tf.constant([-3.])
tf.math.minimum(x, y)
<tf.Tensor: shape=(4,), dtype=float32, numpy=array([-5., -3., -3., -3.], dtype=float32)>
If inputs are not tensors, they will be converted to tensors. See tf.convert_to_tensor.
x = tf.constant([-3.], dtype=tf.float32)
tf.math.minimum([-5], x)
<tf.Tensor: shape=(1,), dtype=float32, numpy=array([-5.], dtype=float32)>
Args
x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int16, int32, int64.
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.minimum |
tf.raw_ops.MirrorPad Pads a tensor with mirrored values. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MirrorPad
tf.raw_ops.MirrorPad(
input, paddings, mode, name=None
)
This operation pads a input with mirrored values according to the paddings you specify. paddings is an integer tensor with shape [n, 2], where n is the rank of input. For each dimension D of input, paddings[D, 0] indicates how many values to add before the contents of input in that dimension, and paddings[D, 1] indicates how many values to add after the contents of input in that dimension. Both paddings[D, 0] and paddings[D, 1] must be no greater than input.dim_size(D) (or input.dim_size(D) - 1) if copy_border is true (if false, respectively). 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, 2, 3], [4, 5, 6]].
# 'paddings' is [[1, 1]], [2, 2]].
# 'mode' is SYMMETRIC.
# rank of 't' is 2.
pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
[2, 1, 1, 2, 3, 3, 2]
[5, 4, 4, 5, 6, 6, 5]
[5, 4, 4, 5, 6, 6, 5]]
Args
input A Tensor. The input tensor to be padded.
paddings A Tensor. Must be one of the following types: int32, int64. A two-column matrix specifying the padding sizes. The number of rows must be the same as the rank of input.
mode A string from: "REFLECT", "SYMMETRIC". Either REFLECT or SYMMETRIC. In reflect mode the padded regions do not include the borders, while in symmetric mode the padded regions do include the borders. For example, if input is [1, 2, 3] and paddings is [0, 2], then the output is [1, 2, 3, 2, 1] in reflect mode, and it is [1, 2, 3, 3, 2] in symmetric mode.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.mirrorpad |
tf.raw_ops.MirrorPadGrad Gradient op for MirrorPad op. This op folds a mirror-padded tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MirrorPadGrad
tf.raw_ops.MirrorPadGrad(
input, paddings, mode, name=None
)
This operation folds the padded areas of input by MirrorPad according to the paddings you specify. paddings must be the same as paddings argument given to the corresponding MirrorPad op. The folded size of each dimension D of the output is: input.dim_size(D) - paddings(D, 0) - paddings(D, 1) For example: # 't' is [[1, 2, 3], [4, 5, 6], [7, 8, 9]].
# 'paddings' is [[0, 1]], [0, 1]].
# 'mode' is SYMMETRIC.
# rank of 't' is 2.
pad(t, paddings) ==> [[ 1, 5]
[11, 28]]
Args
input A Tensor. The input tensor to be folded.
paddings A Tensor. Must be one of the following types: int32, int64. A two-column matrix specifying the padding sizes. The number of rows must be the same as the rank of input.
mode A string from: "REFLECT", "SYMMETRIC". The mode used in the MirrorPad op.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.mirrorpadgrad |
tf.raw_ops.Mod Returns element-wise remainder of division. This emulates C semantics in that View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Mod
tf.raw_ops.Mod(
x, y, name=None
)
the result here is consistent with a truncating divide. E.g. tf.truncatediv(x, y) * y + truncate_mod(x, y) = x.
Note: Mod supports broadcasting. More about broadcasting here
Args
x A Tensor. Must be one of the following types: int32, int64, half, half, bfloat16, float32, float64.
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.mod |
tf.raw_ops.ModelDataset Identity transformation that models performance. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.ModelDataset
tf.raw_ops.ModelDataset(
input_dataset, output_types, output_shapes, algorithm=0, cpu_budget=0,
ram_budget=0, name=None
)
Identity transformation that models performance.
Args
input_dataset A Tensor of type variant. A variant tensor representing the input 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.
algorithm An optional int. Defaults to 0.
cpu_budget An optional int. Defaults to 0.
ram_budget An optional int. Defaults to 0.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.modeldataset |
tf.raw_ops.Mul Returns x * y element-wise. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Mul
tf.raw_ops.Mul(
x, y, name=None
)
Note: Multiply 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.mul |
tf.raw_ops.MulNoNan Returns x * y element-wise. Returns zero if y is zero, even if x if infinite or NaN. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MulNoNan
tf.raw_ops.MulNoNan(
x, y, name=None
)
Note: MulNoNan supports broadcasting. More about broadcasting here
Args
x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, complex64, complex128.
y A Tensor. Must have the same type as x.
name A name for the operation (optional).
Returns A Tensor. Has the same type as x. | tensorflow.raw_ops.mulnonan |
tf.raw_ops.MultiDeviceIterator Creates a MultiDeviceIterator resource. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MultiDeviceIterator
tf.raw_ops.MultiDeviceIterator(
devices, shared_name, container, output_types, output_shapes, name=None
)
Args
devices A list of strings that has length >= 1. A list of devices the iterator works across.
shared_name A string. If non-empty, this resource will be shared under the given name across multiple sessions.
container A string. If non-empty, this resource is placed in the given container. Otherwise, a default container is used.
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.
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.multideviceiterator |
tf.raw_ops.MultiDeviceIteratorFromStringHandle Generates a MultiDeviceIterator resource from its provided string handle. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MultiDeviceIteratorFromStringHandle
tf.raw_ops.MultiDeviceIteratorFromStringHandle(
string_handle, output_types=[], output_shapes=[], name=None
)
Args
string_handle A Tensor of type string. String representing the resource.
output_types An optional list of tf.DTypes. Defaults to []. The type list for the return values.
output_shapes An optional list of shapes (each a tf.TensorShape or list of ints). Defaults to []. The list of shapes being produced.
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.multideviceiteratorfromstringhandle |
tf.raw_ops.MultiDeviceIteratorGetNextFromShard Gets next element for the provided shard number. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MultiDeviceIteratorGetNextFromShard
tf.raw_ops.MultiDeviceIteratorGetNextFromShard(
multi_device_iterator, shard_num, incarnation_id, output_types, output_shapes,
name=None
)
Args
multi_device_iterator A Tensor of type resource. A MultiDeviceIterator resource.
shard_num A Tensor of type int32. Integer representing which shard to fetch data for.
incarnation_id A Tensor of type int64. Which incarnation of the MultiDeviceIterator is running.
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.
name A name for the operation (optional).
Returns A list of Tensor objects of type output_types. | tensorflow.raw_ops.multideviceiteratorgetnextfromshard |
tf.raw_ops.MultiDeviceIteratorInit Initializes the multi device iterator with the given dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MultiDeviceIteratorInit
tf.raw_ops.MultiDeviceIteratorInit(
dataset, multi_device_iterator, max_buffer_size, name=None
)
Args
dataset A Tensor of type variant. Dataset to be iterated upon.
multi_device_iterator A Tensor of type resource. A MultiDeviceIteratorResource.
max_buffer_size A Tensor of type int64. The maximum size of the host side per device buffer to keep.
name A name for the operation (optional).
Returns A Tensor of type int64. | tensorflow.raw_ops.multideviceiteratorinit |
tf.raw_ops.MultiDeviceIteratorToStringHandle Produces a string handle for the given MultiDeviceIterator. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MultiDeviceIteratorToStringHandle
tf.raw_ops.MultiDeviceIteratorToStringHandle(
multi_device_iterator, name=None
)
Args
multi_device_iterator A Tensor of type resource. A MultiDeviceIterator resource.
name A name for the operation (optional).
Returns A Tensor of type string. | tensorflow.raw_ops.multideviceiteratortostringhandle |
tf.raw_ops.Multinomial Draws samples from a multinomial distribution. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Multinomial
tf.raw_ops.Multinomial(
logits, num_samples, seed=0, seed2=0, output_dtype=tf.dtypes.int64, name=None
)
Args
logits A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. 2-D Tensor with shape [batch_size, num_classes]. Each slice [i, :] represents the unnormalized log probabilities for all classes.
num_samples A Tensor of type int32. 0-D. Number of independent samples to draw for each row slice.
seed An optional int. Defaults to 0. If either seed or seed2 is set to be non-zero, the internal random number generator is seeded by the given seed. Otherwise, a random seed is used.
seed2 An optional int. Defaults to 0. A second seed to avoid seed collision.
output_dtype An optional tf.DType from: tf.int32, tf.int64. Defaults to tf.int64.
name A name for the operation (optional).
Returns A Tensor of type output_dtype. | tensorflow.raw_ops.multinomial |
tf.raw_ops.MutableDenseHashTable Creates an empty hash table that uses tensors as the backing store. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MutableDenseHashTable
tf.raw_ops.MutableDenseHashTable(
empty_key, value_dtype, container='', shared_name='',
use_node_name_sharing=False, value_shape=[], initial_num_buckets=131072,
max_load_factor=0.8, name=None
)
It uses "open addressing" with quadratic reprobing to resolve collisions. This op creates a mutable hash table, specifying the type of its keys and values. Each value must be a scalar. Data can be inserted into the table using the insert operations. It does not support the initialization operation.
Args
empty_key A Tensor. The key used to represent empty key buckets internally. Must not be used in insert or lookup operations.
value_dtype A tf.DType. Type of the table values.
container An optional string. Defaults to "". If non-empty, this table is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this table is shared under the given name across multiple sessions.
use_node_name_sharing An optional bool. Defaults to False.
value_shape An optional tf.TensorShape or list of ints. Defaults to []. The shape of each value.
initial_num_buckets An optional int. Defaults to 131072. The initial number of hash table buckets. Must be a power to 2.
max_load_factor An optional float. Defaults to 0.8. The maximum ratio between number of entries and number of buckets before growing the table. Must be between 0 and 1.
name A name for the operation (optional).
Returns A Tensor of type mutable string. | tensorflow.raw_ops.mutabledensehashtable |
tf.raw_ops.MutableDenseHashTableV2 Creates an empty hash table that uses tensors as the backing store. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MutableDenseHashTableV2
tf.raw_ops.MutableDenseHashTableV2(
empty_key, deleted_key, value_dtype, container='',
shared_name='', use_node_name_sharing=False, value_shape=[],
initial_num_buckets=131072, max_load_factor=0.8, name=None
)
It uses "open addressing" with quadratic reprobing to resolve collisions. This op creates a mutable hash table, specifying the type of its keys and values. Each value must be a scalar. Data can be inserted into the table using the insert operations. It does not support the initialization operation.
Args
empty_key A Tensor. The key used to represent empty key buckets internally. Must not be used in insert or lookup operations.
deleted_key A Tensor. Must have the same type as empty_key.
value_dtype A tf.DType. Type of the table values.
container An optional string. Defaults to "". If non-empty, this table is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this table is shared under the given name across multiple sessions.
use_node_name_sharing An optional bool. Defaults to False.
value_shape An optional tf.TensorShape or list of ints. Defaults to []. The shape of each value.
initial_num_buckets An optional int. Defaults to 131072. The initial number of hash table buckets. Must be a power to 2.
max_load_factor An optional float. Defaults to 0.8. The maximum ratio between number of entries and number of buckets before growing the table. Must be between 0 and 1.
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.mutabledensehashtablev2 |
tf.raw_ops.MutableHashTable Creates an empty hash table. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MutableHashTable
tf.raw_ops.MutableHashTable(
key_dtype, value_dtype, container='', shared_name='',
use_node_name_sharing=False, name=None
)
This op creates a mutable hash table, specifying the type of its keys and values. Each value must be a scalar. Data can be inserted into the table using the insert operations. It does not support the initialization operation.
Args
key_dtype A tf.DType. Type of the table keys.
value_dtype A tf.DType. Type of the table values.
container An optional string. Defaults to "". If non-empty, this table is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this table is shared under the given name across multiple sessions.
use_node_name_sharing An optional bool. Defaults to False. If true and shared_name is empty, the table is shared using the node name.
name A name for the operation (optional).
Returns A Tensor of type mutable string. | tensorflow.raw_ops.mutablehashtable |
tf.raw_ops.MutableHashTableOfTensors Creates an empty hash table. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MutableHashTableOfTensors
tf.raw_ops.MutableHashTableOfTensors(
key_dtype, value_dtype, container='', shared_name='',
use_node_name_sharing=False, value_shape=[], name=None
)
This op creates a mutable hash table, specifying the type of its keys and values. Each value must be a vector. Data can be inserted into the table using the insert operations. It does not support the initialization operation.
Args
key_dtype A tf.DType. Type of the table keys.
value_dtype A tf.DType. Type of the table values.
container An optional string. Defaults to "". If non-empty, this table is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this table is shared under the given name across multiple sessions.
use_node_name_sharing An optional bool. Defaults to False.
value_shape An optional tf.TensorShape or list of ints. Defaults to [].
name A name for the operation (optional).
Returns A Tensor of type mutable string. | tensorflow.raw_ops.mutablehashtableoftensors |
tf.raw_ops.MutableHashTableOfTensorsV2 Creates an empty hash table. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MutableHashTableOfTensorsV2
tf.raw_ops.MutableHashTableOfTensorsV2(
key_dtype, value_dtype, container='', shared_name='',
use_node_name_sharing=False, value_shape=[], name=None
)
This op creates a mutable hash table, specifying the type of its keys and values. Each value must be a vector. Data can be inserted into the table using the insert operations. It does not support the initialization operation.
Args
key_dtype A tf.DType. Type of the table keys.
value_dtype A tf.DType. Type of the table values.
container An optional string. Defaults to "". If non-empty, this table is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this table is shared under the given name across multiple sessions.
use_node_name_sharing An optional bool. Defaults to False.
value_shape An optional tf.TensorShape or list of ints. Defaults to [].
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.mutablehashtableoftensorsv2 |
tf.raw_ops.MutableHashTableV2 Creates an empty hash table. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MutableHashTableV2
tf.raw_ops.MutableHashTableV2(
key_dtype, value_dtype, container='', shared_name='',
use_node_name_sharing=False, name=None
)
This op creates a mutable hash table, specifying the type of its keys and values. Each value must be a scalar. Data can be inserted into the table using the insert operations. It does not support the initialization operation.
Args
key_dtype A tf.DType. Type of the table keys.
value_dtype A tf.DType. Type of the table values.
container An optional string. Defaults to "". If non-empty, this table is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this table is shared under the given name across multiple sessions.
use_node_name_sharing An optional bool. Defaults to False. If true and shared_name is empty, the table is shared using the node name.
name A name for the operation (optional).
Returns A Tensor of type resource. | tensorflow.raw_ops.mutablehashtablev2 |
tf.raw_ops.MutexLock Locks a mutex resource. The output is the lock. So long as the lock tensor View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MutexLock
tf.raw_ops.MutexLock(
mutex, name=None
)
is alive, any other request to use MutexLock with this mutex will wait. This is particularly useful for creating a critical section when used in conjunction with MutexLockIdentity:
mutex = mutex_v2(
shared_name=handle_name, container=container, name=name)
def execute_in_critical_section(fn, *args, **kwargs):
lock = gen_resource_variable_ops.mutex_lock(mutex)
with ops.control_dependencies([lock]):
r = fn(*args, **kwargs)
with ops.control_dependencies(nest.flatten(r)):
with ops.colocate_with(mutex):
ensure_lock_exists = mutex_lock_identity(lock)
# Make sure that if any element of r is accessed, all of
# them are executed together.
r = nest.map_structure(tf.identity, r)
with ops.control_dependencies([ensure_lock_exists]):
return nest.map_structure(tf.identity, r)
While fn is running in the critical section, no other functions which wish to use this critical section may run. Often the use case is that two executions of the same graph, in parallel, wish to run fn; and we wish to ensure that only one of them executes at a time. This is especially important if fn modifies one or more variables at a time. It is also useful if two separate functions must share a resource, but we wish to ensure the usage is exclusive.
Args
mutex A Tensor of type resource. The mutex resource to lock.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.mutexlock |
tf.raw_ops.MutexV2 Creates a Mutex resource that can be locked by MutexLock. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.MutexV2
tf.raw_ops.MutexV2(
container='', shared_name='', name=None
)
Args
container An optional string. Defaults to "". If non-empty, this variable is placed in the given container. Otherwise, a default container is used.
shared_name An optional string. Defaults to "". If non-empty, this variable 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.mutexv2 |
tf.raw_ops.NcclAllReduce Outputs a tensor containing the reduction across all input tensors. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NcclAllReduce
tf.raw_ops.NcclAllReduce(
input, reduction, num_devices, shared_name, name=None
)
Outputs a tensor containing the reduction across all input tensors passed to ops within the same `shared_name. The graph should be constructed so if one op runs with shared_name value c, then num_devices ops will run with shared_name value c. Failure to do so will cause the graph execution to fail to complete. input: the input to the reduction data: the value of the reduction across all num_devices devices. reduction: the reduction operation to perform. num_devices: The number of devices participating in this reduction. shared_name: Identifier that shared between ops of the same reduction.
Args
input A Tensor. Must be one of the following types: half, float32, float64, int32, int64.
reduction A string from: "min", "max", "prod", "sum".
num_devices An int.
shared_name A string.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.ncclallreduce |
tf.raw_ops.NcclBroadcast Sends input to all devices that are connected to the output. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NcclBroadcast
tf.raw_ops.NcclBroadcast(
input, shape, name=None
)
Sends input to all devices that are connected to the output. The graph should be constructed so that all ops connected to the output have a valid device assignment, and the op itself is assigned one of these devices. input: The input to the broadcast. output: The same as input. shape: The shape of the input tensor.
Args
input A Tensor. Must be one of the following types: half, float32, float64, int32, int64.
shape A tf.TensorShape or list of ints.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.ncclbroadcast |
tf.raw_ops.NcclReduce Reduces input from num_devices using reduction to a single device. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NcclReduce
tf.raw_ops.NcclReduce(
input, reduction, name=None
)
Reduces input from num_devices using reduction to a single device. The graph should be constructed so that all inputs have a valid device assignment, and the op itself is assigned one of these devices. input: The input to the reduction. data: the value of the reduction across all num_devices devices. reduction: the reduction operation to perform.
Args
input A list of at least 1 Tensor objects with the same type in: half, float32, float64, int32, int64.
reduction A string from: "min", "max", "prod", "sum".
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.ncclreduce |
tf.raw_ops.Ndtri View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Ndtri
tf.raw_ops.Ndtri(
x, name=None
)
Args
x A Tensor. Must be one of the following types: bfloat16, half, float32, float64.
name A name for the operation (optional).
Returns A Tensor. Has the same type as x. | tensorflow.raw_ops.ndtri |
tf.raw_ops.Neg Computes numerical negative value element-wise. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.Neg
tf.raw_ops.Neg(
x, name=None
)
I.e., \(y = -x\).
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.neg |
tf.raw_ops.NextAfter Returns the next representable value of x1 in the direction of x2, element-wise. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NextAfter
tf.raw_ops.NextAfter(
x1, x2, name=None
)
This operation returns the same result as the C++ std::nextafter function. It can also return a subnormal number.
Args
x1 A Tensor. Must be one of the following types: float64, float32.
x2 A Tensor. Must have the same type as x1.
name A name for the operation (optional).
Returns A Tensor. Has the same type as x1.
Cpp Compatibility Equivalent to C++ std::nextafter function. | tensorflow.raw_ops.nextafter |
tf.raw_ops.NextIteration Makes its input available to the next iteration. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NextIteration
tf.raw_ops.NextIteration(
data, name=None
)
Args
data A Tensor. The tensor to be made available to the next iteration.
name A name for the operation (optional).
Returns A Tensor. Has the same type as data. | tensorflow.raw_ops.nextiteration |
tf.raw_ops.NonDeterministicInts Non-deterministically generates some integers. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NonDeterministicInts
tf.raw_ops.NonDeterministicInts(
shape, dtype=tf.dtypes.int64, name=None
)
This op may use some OS-provided source of non-determinism (e.g. an RNG), so each execution will give different results.
Args
shape A Tensor. The shape of the output tensor.
dtype An optional tf.DType. Defaults to tf.int64. The type of the output.
name A name for the operation (optional).
Returns A Tensor of type dtype. | tensorflow.raw_ops.nondeterministicints |
tf.raw_ops.NonMaxSuppression Greedily selects a subset of bounding boxes in descending order of score, View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NonMaxSuppression
tf.raw_ops.NonMaxSuppression(
boxes, scores, max_output_size, iou_threshold=0.5, name=None
)
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system. Note that this algorithm is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the tf.gather operation. For example: selected_indices = tf.image.non_max_suppression( boxes, scores, max_output_size, iou_threshold) selected_boxes = tf.gather(boxes, selected_indices)
Args
boxes A Tensor of type float32. A 2-D float tensor of shape [num_boxes, 4].
scores A Tensor of type float32. A 1-D float tensor of shape [num_boxes] representing a single score corresponding to each box (each row of boxes).
max_output_size A Tensor of type int32. A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
iou_threshold An optional float. Defaults to 0.5. A float representing the threshold for deciding whether boxes overlap too much with respect to IOU.
name A name for the operation (optional).
Returns A Tensor of type int32. | tensorflow.raw_ops.nonmaxsuppression |
tf.raw_ops.NonMaxSuppressionV2 Greedily selects a subset of bounding boxes in descending order of score, View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NonMaxSuppressionV2
tf.raw_ops.NonMaxSuppressionV2(
boxes, scores, max_output_size, iou_threshold, name=None
)
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system. Note that this algorithm is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the tf.gather operation. For example: selected_indices = tf.image.non_max_suppression_v2( boxes, scores, max_output_size, iou_threshold) selected_boxes = tf.gather(boxes, selected_indices)
Args
boxes A Tensor. Must be one of the following types: half, float32. A 2-D float tensor of shape [num_boxes, 4].
scores A Tensor. Must have the same type as boxes. A 1-D float tensor of shape [num_boxes] representing a single score corresponding to each box (each row of boxes).
max_output_size A Tensor of type int32. A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
iou_threshold A Tensor. Must be one of the following types: half, float32. A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
name A name for the operation (optional).
Returns A Tensor of type int32. | tensorflow.raw_ops.nonmaxsuppressionv2 |
tf.raw_ops.NonMaxSuppressionV3 Greedily selects a subset of bounding boxes in descending order of score, View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NonMaxSuppressionV3
tf.raw_ops.NonMaxSuppressionV3(
boxes, scores, max_output_size, iou_threshold, score_threshold, name=None
)
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than score_threshold are removed. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the tf.gather operation. For example: selected_indices = tf.image.non_max_suppression_v2( boxes, scores, max_output_size, iou_threshold, score_threshold) selected_boxes = tf.gather(boxes, selected_indices)
Args
boxes A Tensor. Must be one of the following types: half, float32. A 2-D float tensor of shape [num_boxes, 4].
scores A Tensor. Must have the same type as boxes. A 1-D float tensor of shape [num_boxes] representing a single score corresponding to each box (each row of boxes).
max_output_size A Tensor of type int32. A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
iou_threshold A Tensor. Must be one of the following types: half, float32. A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
score_threshold A Tensor. Must have the same type as iou_threshold. A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
name A name for the operation (optional).
Returns A Tensor of type int32. | tensorflow.raw_ops.nonmaxsuppressionv3 |
tf.raw_ops.NonMaxSuppressionV4 Greedily selects a subset of bounding boxes in descending order of score, View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NonMaxSuppressionV4
tf.raw_ops.NonMaxSuppressionV4(
boxes, scores, max_output_size, iou_threshold, score_threshold,
pad_to_max_output_size=False, name=None
)
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than score_threshold are removed. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the tf.gather operation. For example: selected_indices = tf.image.non_max_suppression_v2( boxes, scores, max_output_size, iou_threshold, score_threshold) selected_boxes = tf.gather(boxes, selected_indices)
Args
boxes A Tensor. Must be one of the following types: half, float32. A 2-D float tensor of shape [num_boxes, 4].
scores A Tensor. Must have the same type as boxes. A 1-D float tensor of shape [num_boxes] representing a single score corresponding to each box (each row of boxes).
max_output_size A Tensor of type int32. A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
iou_threshold A Tensor. Must be one of the following types: half, float32. A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
score_threshold A Tensor. Must have the same type as iou_threshold. A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
pad_to_max_output_size An optional bool. Defaults to False. If true, the output selected_indices is padded to be of length max_output_size. Defaults to false.
name A name for the operation (optional).
Returns A tuple of Tensor objects (selected_indices, valid_outputs). selected_indices A Tensor of type int32.
valid_outputs A Tensor of type int32. | tensorflow.raw_ops.nonmaxsuppressionv4 |
tf.raw_ops.NonMaxSuppressionV5 Greedily selects a subset of bounding boxes in descending order of score, View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NonMaxSuppressionV5
tf.raw_ops.NonMaxSuppressionV5(
boxes, scores, max_output_size, iou_threshold, score_threshold, soft_nms_sigma,
pad_to_max_output_size=False, name=None
)
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than score_threshold are removed. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the tf.gather operation. For example: selected_indices = tf.image.non_max_suppression_v2( boxes, scores, max_output_size, iou_threshold, score_threshold) selected_boxes = tf.gather(boxes, selected_indices) This op also supports a Soft-NMS (with Gaussian weighting) mode (c.f. Bodla et al, https://arxiv.org/abs/1704.04503) where boxes reduce the score of other overlapping boxes instead of directly causing them to be pruned. To enable this Soft-NMS mode, set the soft_nms_sigma parameter to be larger than 0.
Args
boxes A Tensor. Must be one of the following types: half, float32. A 2-D float tensor of shape [num_boxes, 4].
scores A Tensor. Must have the same type as boxes. A 1-D float tensor of shape [num_boxes] representing a single score corresponding to each box (each row of boxes).
max_output_size A Tensor of type int32. A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
iou_threshold A Tensor. Must have the same type as boxes. A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
score_threshold A Tensor. Must have the same type as boxes. A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
soft_nms_sigma A Tensor. Must have the same type as boxes. A 0-D float tensor representing the sigma parameter for Soft NMS; see Bodla et al (c.f. https://arxiv.org/abs/1704.04503). When soft_nms_sigma=0.0 (which is default), we fall back to standard (hard) NMS.
pad_to_max_output_size An optional bool. Defaults to False. If true, the output selected_indices is padded to be of length max_output_size. Defaults to false.
name A name for the operation (optional).
Returns A tuple of Tensor objects (selected_indices, selected_scores, valid_outputs). selected_indices A Tensor of type int32.
selected_scores A Tensor. Has the same type as boxes.
valid_outputs A Tensor of type int32. | tensorflow.raw_ops.nonmaxsuppressionv5 |
tf.raw_ops.NonMaxSuppressionWithOverlaps Greedily selects a subset of bounding boxes in descending order of score, View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NonMaxSuppressionWithOverlaps
tf.raw_ops.NonMaxSuppressionWithOverlaps(
overlaps, scores, max_output_size, overlap_threshold, score_threshold, name=None
)
pruning away boxes that have high overlaps with previously selected boxes. Bounding boxes with score less than score_threshold are removed. N-by-n overlap values are supplied as square matrix, which allows for defining a custom overlap criterium (eg. intersection over union, intersection over area, etc.). The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the tf.gather operation. For example: selected_indices = tf.image.non_max_suppression_with_overlaps( overlaps, scores, max_output_size, overlap_threshold, score_threshold) selected_boxes = tf.gather(boxes, selected_indices)
Args
overlaps A Tensor of type float32. A 2-D float tensor of shape [num_boxes, num_boxes] representing the n-by-n box overlap values.
scores A Tensor of type float32. A 1-D float tensor of shape [num_boxes] representing a single score corresponding to each box (each row of boxes).
max_output_size A Tensor of type int32. A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
overlap_threshold A Tensor of type float32. A 0-D float tensor representing the threshold for deciding whether boxes overlap too.
score_threshold A Tensor of type float32. A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
name A name for the operation (optional).
Returns A Tensor of type int32. | tensorflow.raw_ops.nonmaxsuppressionwithoverlaps |
tf.raw_ops.NonSerializableDataset View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NonSerializableDataset
tf.raw_ops.NonSerializableDataset(
input_dataset, output_types, output_shapes, name=None
)
Args
input_dataset A Tensor of type variant.
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.nonserializabledataset |
tf.raw_ops.NoOp Does nothing. Only useful as a placeholder for control edges. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NoOp
tf.raw_ops.NoOp(
name=None
)
Args
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.noop |
tf.raw_ops.NotEqual Returns the truth value of (x != y) element-wise. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NotEqual
tf.raw_ops.NotEqual(
x, y, incompatible_shape_error=True, name=None
)
Note: NotEqual supports broadcasting. More about broadcasting here
Args
x A Tensor.
y A Tensor. Must have the same type as x.
incompatible_shape_error An optional bool. Defaults to True.
name A name for the operation (optional).
Returns A Tensor of type bool. | tensorflow.raw_ops.notequal |
tf.raw_ops.NthElement Finds values of the n-th order statistic for the last dimension. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.NthElement
tf.raw_ops.NthElement(
input, n, reverse=False, name=None
)
If the input is a vector (rank-1), finds the entries which is the nth-smallest value in the vector and outputs their values as scalar tensor. For matrices (resp. higher rank input), computes the entries which is the nth-smallest value in each row (resp. vector along the last dimension). Thus, values.shape = input.shape[:-1]
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 n+1.
n A Tensor of type int32. 0-D. Position of sorted vector to select along the last dimension (along each row for matrices). Valid range of n is [0, input.shape[:-1])
reverse An optional bool. Defaults to False. When set to True, find the nth-largest value in the vector and vice versa.
name A name for the operation (optional).
Returns A Tensor. Has the same type as input. | tensorflow.raw_ops.nthelement |
tf.raw_ops.OneHot Returns a one-hot tensor. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OneHot
tf.raw_ops.OneHot(
indices, depth, on_value, off_value, axis=-1, name=None
)
The locations represented by indices in indices take value on_value, while all other locations take value off_value. If the input indices is rank N, the output will have rank N+1, The new axis is created at dimension axis (default: the new axis is appended at the end). If indices is a scalar the output shape will be a vector of length depth. If indices is a vector of length features, the output shape will be: features x depth if axis == -1
depth x features if axis == 0
If indices is a matrix (batch) with shape [batch, features], the output shape will be: batch x features x depth if axis == -1
batch x depth x features if axis == 1
depth x batch x features if axis == 0
Examples Suppose that indices = [0, 2, -1, 1]
depth = 3
on_value = 5.0
off_value = 0.0
axis = -1
Then output is [4 x 3]: output =
[5.0 0.0 0.0] // one_hot(0)
[0.0 0.0 5.0] // one_hot(2)
[0.0 0.0 0.0] // one_hot(-1)
[0.0 5.0 0.0] // one_hot(1)
Suppose that indices = [0, 2, -1, 1]
depth = 3
on_value = 0.0
off_value = 3.0
axis = 0
Then output is [3 x 4]: output =
[0.0 3.0 3.0 3.0]
[3.0 3.0 3.0 0.0]
[3.0 3.0 3.0 3.0]
[3.0 0.0 3.0 3.0]
// ^ one_hot(0)
// ^ one_hot(2)
// ^ one_hot(-1)
// ^ one_hot(1)
Suppose that indices = [[0, 2], [1, -1]]
depth = 3
on_value = 1.0
off_value = 0.0
axis = -1
Then output is [2 x 2 x 3]: output =
[
[1.0, 0.0, 0.0] // one_hot(0)
[0.0, 0.0, 1.0] // one_hot(2)
][
[0.0, 1.0, 0.0] // one_hot(1)
[0.0, 0.0, 0.0] // one_hot(-1)
]
Args
indices A Tensor. Must be one of the following types: uint8, int32, int64. A tensor of indices.
depth A Tensor of type int32. A scalar defining the depth of the one hot dimension.
on_value A Tensor. A scalar defining the value to fill in output when indices[j] = i.
off_value A Tensor. Must have the same type as on_value. A scalar defining the value to fill in output when indices[j] != i.
axis An optional int. Defaults to -1. The axis to fill (default: -1, a new inner-most axis).
name A name for the operation (optional).
Returns A Tensor. Has the same type as on_value. | tensorflow.raw_ops.onehot |
tf.raw_ops.OneShotIterator Makes a "one-shot" iterator that can be iterated only once. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OneShotIterator
tf.raw_ops.OneShotIterator(
dataset_factory, output_types, output_shapes, container='',
shared_name='', name=None
)
A one-shot iterator bundles the logic for defining the dataset and the state of the iterator in a single op, which allows simple input pipelines to be defined without an additional initialization ("MakeIterator") step. One-shot iterators have the following limitations: They do not support parameterization: all logic for creating the underlying dataset must be bundled in the dataset_factory function. They are not resettable. Once a one-shot iterator reaches the end of its underlying dataset, subsequent "IteratorGetNext" operations on that iterator will always produce an OutOfRange error. For greater flexibility, use "Iterator" and "MakeIterator" to define an iterator using an arbitrary subgraph, which may capture tensors (including fed values) as parameters, and which may be reset multiple times by rerunning "MakeIterator".
Args
dataset_factory A function decorated with @Defun. A function of type () -> DT_VARIANT, where the returned DT_VARIANT is a 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.
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.oneshotiterator |
tf.raw_ops.OnesLike Returns a tensor of ones with the same shape and type as x. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OnesLike
tf.raw_ops.OnesLike(
x, name=None
)
Args
x A Tensor. Must be one of the following types: bfloat16, half, float32, float64, int8, uint8, int16, uint16, int32, int64, complex64, complex128, bool. a tensor of type T.
name A name for the operation (optional).
Returns A Tensor. Has the same type as x. | tensorflow.raw_ops.oneslike |
tf.raw_ops.OptimizeDataset Creates a dataset by applying optimizations to input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OptimizeDataset
tf.raw_ops.OptimizeDataset(
input_dataset, optimizations, output_types, output_shapes,
optimization_configs=[], name=None
)
Creates a dataset by applying optimizations to input_dataset.
Args
input_dataset A Tensor of type variant. A variant tensor representing the input dataset.
optimizations A Tensor of type string. A tf.string vector tf.Tensor identifying optimizations to use.
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.
optimization_configs An optional list of strings. Defaults to [].
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.optimizedataset |
tf.raw_ops.OptimizeDatasetV2 Creates a dataset by applying related optimizations to input_dataset. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OptimizeDatasetV2
tf.raw_ops.OptimizeDatasetV2(
input_dataset, optimizations_enabled, optimizations_disabled,
optimizations_default, output_types, output_shapes, optimization_configs=[],
name=None
)
Creates a dataset by applying related optimizations to input_dataset.
Args
input_dataset A Tensor of type variant. A variant tensor representing the input dataset.
optimizations_enabled A Tensor of type string. A tf.string vector tf.Tensor identifying user enabled optimizations.
optimizations_disabled A Tensor of type string. A tf.string vector tf.Tensor identifying user disabled optimizations.
optimizations_default A Tensor of type string. A tf.string vector tf.Tensor identifying optimizations by default.
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.
optimization_configs An optional list of strings. Defaults to [].
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.optimizedatasetv2 |
tf.raw_ops.OptionalFromValue Constructs an Optional variant from a tuple of tensors. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OptionalFromValue
tf.raw_ops.OptionalFromValue(
components, name=None
)
Args
components A list of Tensor objects.
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.optionalfromvalue |
tf.raw_ops.OptionalGetValue Returns the value stored in an Optional variant or raises an error if none exists. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OptionalGetValue
tf.raw_ops.OptionalGetValue(
optional, output_types, output_shapes, name=None
)
Args
optional A Tensor of type variant.
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 list of Tensor objects of type output_types. | tensorflow.raw_ops.optionalgetvalue |
tf.raw_ops.OptionalHasValue Returns true if and only if the given Optional variant has a value. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OptionalHasValue
tf.raw_ops.OptionalHasValue(
optional, name=None
)
Args
optional A Tensor of type variant.
name A name for the operation (optional).
Returns A Tensor of type bool. | tensorflow.raw_ops.optionalhasvalue |
tf.raw_ops.OptionalNone Creates an Optional variant with no value. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OptionalNone
tf.raw_ops.OptionalNone(
name=None
)
Args
name A name for the operation (optional).
Returns A Tensor of type variant. | tensorflow.raw_ops.optionalnone |
tf.raw_ops.OrderedMapClear Op removes all elements in the underlying container. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OrderedMapClear
tf.raw_ops.OrderedMapClear(
dtypes, capacity=0, memory_limit=0, container='',
shared_name='', name=None
)
Args
dtypes A list of tf.DTypes.
capacity An optional int that is >= 0. Defaults to 0.
memory_limit An optional int that is >= 0. Defaults to 0.
container An optional string. Defaults to "".
shared_name An optional string. Defaults to "".
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.orderedmapclear |
tf.raw_ops.OrderedMapIncompleteSize Op returns the number of incomplete elements in the underlying container. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OrderedMapIncompleteSize
tf.raw_ops.OrderedMapIncompleteSize(
dtypes, capacity=0, memory_limit=0, container='',
shared_name='', name=None
)
Args
dtypes A list of tf.DTypes.
capacity An optional int that is >= 0. Defaults to 0.
memory_limit An optional int that is >= 0. Defaults to 0.
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 int32. | tensorflow.raw_ops.orderedmapincompletesize |
tf.raw_ops.OrderedMapPeek Op peeks at the values at the specified key. If the View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OrderedMapPeek
tf.raw_ops.OrderedMapPeek(
key, indices, dtypes, capacity=0, memory_limit=0, container='',
shared_name='', name=None
)
underlying container does not contain this key this op will block until it does. This Op is optimized for performance.
Args
key A Tensor of type int64.
indices A Tensor of type int32.
dtypes A list of tf.DTypes that has length >= 1.
capacity An optional int that is >= 0. Defaults to 0.
memory_limit An optional int that is >= 0. Defaults to 0.
container An optional string. Defaults to "".
shared_name An optional string. Defaults to "".
name A name for the operation (optional).
Returns A list of Tensor objects of type dtypes. | tensorflow.raw_ops.orderedmappeek |
tf.raw_ops.OrderedMapSize Op returns the number of elements in the underlying container. View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OrderedMapSize
tf.raw_ops.OrderedMapSize(
dtypes, capacity=0, memory_limit=0, container='',
shared_name='', name=None
)
Args
dtypes A list of tf.DTypes.
capacity An optional int that is >= 0. Defaults to 0.
memory_limit An optional int that is >= 0. Defaults to 0.
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 int32. | tensorflow.raw_ops.orderedmapsize |
tf.raw_ops.OrderedMapStage Stage (key, values) in the underlying container which behaves like a ordered View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OrderedMapStage
tf.raw_ops.OrderedMapStage(
key, indices, values, dtypes, capacity=0, memory_limit=0,
container='', shared_name='', name=None
)
associative container. Elements are ordered by key.
Args
key A Tensor of type int64. int64
indices A Tensor of type int32.
values A list of Tensor objects. a list of tensors dtypes A list of data types that inserted values should adhere to.
dtypes A list of tf.DTypes.
capacity An optional int that is >= 0. Defaults to 0. Maximum number of elements in the Staging Area. If > 0, inserts on the container will block when the capacity is reached.
memory_limit An optional int that is >= 0. Defaults to 0.
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 "". It is necessary to match this name to the matching Unstage Op.
name A name for the operation (optional).
Returns The created Operation. | tensorflow.raw_ops.orderedmapstage |
tf.raw_ops.OrderedMapUnstage Op removes and returns the values associated with the key View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OrderedMapUnstage
tf.raw_ops.OrderedMapUnstage(
key, indices, dtypes, capacity=0, memory_limit=0, container='',
shared_name='', name=None
)
from the underlying container. If the underlying container does not contain this key, the op will block until it does.
Args
key A Tensor of type int64.
indices A Tensor of type int32.
dtypes A list of tf.DTypes that has length >= 1.
capacity An optional int that is >= 0. Defaults to 0.
memory_limit An optional int that is >= 0. Defaults to 0.
container An optional string. Defaults to "".
shared_name An optional string. Defaults to "".
name A name for the operation (optional).
Returns A list of Tensor objects of type dtypes. | tensorflow.raw_ops.orderedmapunstage |
tf.raw_ops.OrderedMapUnstageNoKey Op removes and returns the (key, value) element with the smallest View aliases Compat aliases for migration
See Migration guide for more details. tf.compat.v1.raw_ops.OrderedMapUnstageNoKey
tf.raw_ops.OrderedMapUnstageNoKey(
indices, dtypes, capacity=0, memory_limit=0, container='',
shared_name='', name=None
)
key from the underlying container. If the underlying container does not contain elements, the op will block until it does.
Args
indices A Tensor of type int32.
dtypes A list of tf.DTypes that has length >= 1.
capacity An optional int that is >= 0. Defaults to 0.
memory_limit An optional int that is >= 0. Defaults to 0.
container An optional string. Defaults to "".
shared_name An optional string. Defaults to "".
name A name for the operation (optional).
Returns A tuple of Tensor objects (key, values). key A Tensor of type int64.
values A list of Tensor objects of type dtypes. | tensorflow.raw_ops.orderedmapunstagenokey |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.