代码拉取完成,页面将自动刷新
.. py:function:: mindspore.ops.rand(*size, dtype=None, seed=None) 返回一个Tensor,shape和dtype由输入决定,其元素为服从均匀分布的 :math:`[0, 1)` 区间的数字。 参数: - **size** (Union[int, tuple(int), list(int)]) - 输出的Tensor的shape,例如,:math:`(2, 3)` or :math:`2`。 关键字参数: - **dtype** (:class:`mindspore.dtype`,可选) - 指定的输出Tensor的dtype,必须是float类型。如果是None,`mindspore.float32` 会被使用。默认值: ``None`` 。 - **seed** (int,可选) - 随机种子,必须大于或等于0。默认值: ``None`` ,值将取 ``0`` 。 返回: Tensor,shape和dtype由输入决定其元素为服从均匀分布的 :math:`[0, 1)` 区间的数字。 异常: - **TypeError** - 如果 `seed` 不是非负整数。 - **ValueError** - 如果 `dtype` 不是一个 `mstype.float_type` 类型。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。