mindspore/docs/api/api_python/nn/mindspore.nn.Range.rst

21 lines
986 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.nn.Range
===================
.. py:class:: mindspore.nn.Range(start, limit=None, delta=1)
根据指定步长在范围[start, limit)中创建数字序列。
输出的数据长度为 :math:`\left \lfloor \frac{limit-start}{delta} \right \rfloor + 1` 并且 `delta` 是Tensor中两个值之间的间隔。
.. math::
out_{i+1} = out_{i} + delta
**参数:**
- **start** (Union[int, float]) - 如果 `limit` 为None则该值在范围内充当结束0为起始。否则 `start` 将充当范围中的起始。
- **limit** (Union[int, float]) - 序列的上限。如果为None则默认为 `start` 的值同时将范围内的0作为起始。它不能等于 `start` 。默认值None。
- **delta** (Union[int, float]) - 指定步长。不能等于零。默认值1。
**输出:**
Tensor如果 `start``limit``delta` 的数据类型都是int则数据类型为int。否则数据类型为float。