sponge.function.gather_value ================================= .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.2/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindscience/blob/r0.5/MindSPONGE/docs/api/api_python/function/sponge.function.gather_value.rst :alt: 查看源文件 .. py:function:: sponge.function.gather_value(tensor: Tensor, index: Tensor) 根据指标从张量的最后一根轴收集值。 参数: - **tensor** (Tensor) - 输入张量,shape为 :math:`(B, X)` 。其中 :math:`B` 为batch size, :math:`X` 为输入张量第二维的任意大小。 - **index** (Tensor) - 索引,shape为 :math:`(B, ...,)` 。 返回: Tensor。取出的值,shape为 :math:`(B, ...,)` 。