sponge.function.gather_value

查看源文件
sponge.function.gather_value(tensor: Tensor, index: Tensor)[源代码]

根据指标从张量的最后一根轴收集值。

参数:
  • tensor (Tensor) - 输入张量,shape为 (B,X) 。其中 B 为batch size, X 为输入张量第二维的任意大小。

  • index (Tensor) - 索引,shape为 (B,...,)

返回:

Tensor。取出的值,shape为 (B,...,)

支持平台:

Ascend GPU