From ca29abc813b9423d139fe974fb9ff33cd87078e5 Mon Sep 17 00:00:00 2001 From: silingtong123 <35439432+silingtong123@users.noreply.github.com> Date: Thu, 14 May 2020 20:38:31 +0800 Subject: [PATCH] test=develop, test=document_fix, modify the code example of randont (#24533) Co-authored-by: root --- python/paddle/tensor/random.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/paddle/tensor/random.py b/python/paddle/tensor/random.py index 68fe78f22fc..02709e568a6 100644 --- a/python/paddle/tensor/random.py +++ b/python/paddle/tensor/random.py @@ -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") -- GitLab