未验证 提交 ca29abc8 编写于 作者: S silingtong123 提交者: GitHub

test=develop, test=document_fix, modify the code example of randont (#24533)

Co-authored-by: Nroot <root@yq01-gpu-151-22-00.epc.baidu.com>
上级 8ef3c02e
......@@ -88,8 +88,9 @@ def randint(low,
Examples:
.. code-block:: python
import paddle
import paddle.tensor as tensor
import paddle.fluid as fluid
# example 1:
# attr shape is a list which doesn't contain tensor Variable.
......@@ -104,7 +105,7 @@ def randint(low,
# example 3:
# attr shape is a Variable, the data type must be int64 or int32.
var_shape = fluid.data(name='var_shape', shape=[2], dtype="int64")
result_3 = padddle.randint(low=-5, high=5, shape=var_shape, dtype="int32")
result_3 = paddle.randint(low=-5, high=5, shape=var_shape, dtype="int32")
var_shape_int32 = fluid.data(name='var_shape_int32', shape=[2], dtype="int32")
result_4 = paddle.randint(low=-5, high=5, shape=var_shape_int32, dtype="int64")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册