mindspore.mint.rand_like ======================== .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/br_base/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/br_base/docs/api/api_python/mint/mindspore.mint.func_rand_like.rst :alt: 查看源文件 .. py:function:: mindspore.mint.rand_like(input, *, dtype=None) 返回shape与输入相同,类型为 `dtype` 的Tensor,dtype由输入决定,其元素取值服从 :math:`[0, 1)` 区间内的均匀分布。 参数: - **input** (Tensor) - 输入的Tensor,用来决定输出Tensor的shape和默认的dtype。 关键字参数: - **dtype** (:class:`mindspore.dtype`,可选) - 指定的输出Tensor的dtype,必须是float类型。如果是 ``None`` ,`input` 的dtype会被使用。默认值: ``None`` 。 返回: Tensor,shape和dtype由输入决定其元素为服从均匀分布的 :math:`[0, 1)` 区间的数字。