mindspore/docs/api/api_python/ops/mindspore.ops.func_randint.rst

22 lines
738 B
ReStructuredText
Raw Permalink 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.ops.randint
======================
.. py:function:: mindspore.ops.randint(low, high, size, seed=None, *, dtype=None)
返回一个tensor其元素为 [ `low` , `high` ) 区间的随机整数。
.. warning::
Ascend后端不支持随机数重现功能 `seed` 参数不起作用。
参数:
- **low** (int) - 随机区间的起始值。
- **high** (int) - 随机区间的末尾值。
- **size** (tuple) - 输出tensor的shape。
- **seed** (int可选) - 随机种子必须大于或等于0。默认 ``None``
关键字参数:
- **dtype** (:class:`mindspore.dtype`,可选) - 指定数据类型。默认 ``None``
返回:
Tensor