tf.raw_ops.ResourceGather
Сбор срезов из переменной, на которую указывает resource, согласно indices.
tf.raw_ops.ResourceGather(
resource, indices, dtype, batch_dims=0, validate_indices=True, name=None
)
indices должен быть целочисленным тензором любой размерности (обычно 0-й или 1-й). Создаёт тензор вывода с формой 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], :, ..., :]
| Аргументы | |
|---|---|
resource | A Tensor типа resource. |
indices | A Tensor. Должен быть одного из следующих типов: int32, int64. |
dtype | A tf.DType. |
batch_dims | Необязательный int. По умолчанию 0. |
validate_indices | Необязательный bool. По умолчанию True. |
name | Имя операции (необязательно). |
| Возвращаемое значение | |
|---|---|
A Tensor типа dtype. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/raw_ops/ResourceGather