From b0c7cae018a66f433226772ca0855531de19b1f5 Mon Sep 17 00:00:00 2001 From: yanzhenxiang2020 Date: Sat, 30 Jan 2021 15:53:50 +0800 Subject: [PATCH] add GatherD comments --- mindspore/ops/operations/array_ops.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index a033e0edc3..7c7b95d079 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -4649,6 +4649,17 @@ class GatherD(PrimitiveWithInfer): """ Gathers values along an axis specified by dim. + For a 3-D tensor, the output is: + output[i][j][k] = x[index[i][j][k]][j][k] # if dim == 0 + + output[i][j][k] = x[i][index[i][j][k]][k] # if dim == 1 + + output[i][j][k] = x[i][j][index[i][j][k]] # if dim == 2 + + If `x` is an n-D tensor with shape :math:`(z_0, z_1, ..., z_i, ..., z_{n-1})` and `dim` = i, + the `index` must be an n-D tensor with shape :math:`(z_0, z_1, ..., y, ..., z_{n-1})` + where `y`>=1 and the output will have the same shape as `index`. + Inputs: - **x** (Tensor) - The source tensor. - **dim** (int) - The axis along which to index. It must be int32. Only constant value is allowed.