Skip to content

Commit ca29abc

Browse files
silingtong123root
andauthored
test=develop, test=document_fix, modify the code example of randont (#24533)
Co-authored-by: root <[email protected]>
1 parent 8ef3c02 commit ca29abc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/paddle/tensor/random.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ def randint(low,
8888
8989
Examples:
9090
.. code-block:: python
91+
9192
import paddle
92-
import paddle.tensor as tensor
93+
import paddle.fluid as fluid
9394
9495
# example 1:
9596
# attr shape is a list which doesn't contain tensor Variable.
@@ -104,7 +105,7 @@ def randint(low,
104105
# example 3:
105106
# attr shape is a Variable, the data type must be int64 or int32.
106107
var_shape = fluid.data(name='var_shape', shape=[2], dtype="int64")
107-
result_3 = padddle.randint(low=-5, high=5, shape=var_shape, dtype="int32")
108+
result_3 = paddle.randint(low=-5, high=5, shape=var_shape, dtype="int32")
108109
var_shape_int32 = fluid.data(name='var_shape_int32', shape=[2], dtype="int32")
109110
result_4 = paddle.randint(low=-5, high=5, shape=var_shape_int32, dtype="int64")
110111

0 commit comments

Comments
 (0)