mindspore.Tensor.stride ======================================= .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/master/docs/api/api_python/mindspore/Tensor/mindspore.Tensor.stride.rst :alt: 查看源文件 .. py:method:: mindspore.Tensor.stride(dim=None) 在指定维度 `dim中` 从一个元素跳到下一个元素所必需的步长。当没有参数传入时,返回所有维度的步长的列表。 参数: - **dim** (int) - 指定的维度。 返回: int,返回在指定维度下,从一个元素调到下一个元素所必需的步长。 异常: - **TypeError** - `dim` 不是int。