sponge.function.gather_vector
==================================

.. 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_vector.rst
    :alt: 查看源文件


.. py:function:: sponge.function.gather_vector(tensor: Tensor, index: Tensor)

    根据指标从张量的倒数第二轴收集向量。

    参数:
        - **tensor** (Tensor) - 输入张量,shape为 :math:`(B, X, D)` 。其中 :math:`B` 为batch size, :math:`X` 为任意大小, :math:`D` 为模拟系统的维度,通常为3。
        - **index** (Tensor) - 索引,shape为 :math:`(B, ...,)`。

    返回:
        Tensor。取出的向量。shape为 :math:`(B, ..., D)`。