根据 indices 从 resource 指向的变量中收集切片。
用法
tf.raw_ops.ResourceGather(
resource, indices, dtype, batch_dims=0, validate_indices=True, name=None
)参数
-
resourceTensor类型为resource。 -
indices一个Tensor。必须是以下类型之一:int32,int64。 -
dtype一个tf.DType。 -
batch_dims可选的int。默认为0。 -
validate_indices可选的bool。默认为True。 -
name操作的名称(可选)。
返回
-
Tensor类型为dtype。
indices 必须是任意维度的整数张量(通常为 0-D 或 1-D)。生成形状为 indices.shape + params.shape[1:] 的输出张量,其中:
# Scalar indices
output[:, ...,:] = params[indices,:, ...:]
# Vector indices
output[i,:, ...,:] = params[indices[i],:, ...:]
# Higher rank indices
output[i, ..., j,:, ...:] = params[indices[i, ..., j],:, ...,:]
相关用法
- Python tf.raw_ops.ResourceScatterNdSub用法及代码示例
- Python tf.raw_ops.ResourceScatterMul用法及代码示例
- Python tf.raw_ops.ResourceScatterAdd用法及代码示例
- Python tf.raw_ops.ResourceScatterMax用法及代码示例
- Python tf.raw_ops.ResourceScatterMin用法及代码示例
- Python tf.raw_ops.ResourceScatterNdAdd用法及代码示例
- Python tf.raw_ops.ResourceScatterNdUpdate用法及代码示例
- Python tf.raw_ops.ResourceScatterSub用法及代码示例
- Python tf.raw_ops.ResourceScatterUpdate用法及代码示例
- Python tf.raw_ops.ResourceScatterDiv用法及代码示例
- Python tf.raw_ops.Reshape用法及代码示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代码示例
- Python tf.raw_ops.ReduceJoin用法及代码示例
- Python tf.raw_ops.Real用法及代码示例
- Python tf.raw_ops.Relu用法及代码示例
- Python tf.raw_ops.ReverseV2用法及代码示例
- Python tf.raw_ops.Reverse用法及代码示例
- Python tf.raw_ops.RegexFullMatch用法及代码示例
- Python tf.raw_ops.ReverseSequence用法及代码示例
- Python tf.raw_ops.RaggedGather用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.raw_ops.ResourceGather。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
