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

Co-authored-by: root <root@yq01-gpu-151-22-00.epc.baidu.com>
release/2.0-alpha
silingtong123 5 years ago committed by GitHub
parent 8ef3c02e90
commit ca29abc813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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")

Loading…
Cancel
Save