根據 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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
