Add new inplace api Tensor.uniform_, test=develop#33934
Add new inplace api Tensor.uniform_, test=develop#33934jerrywgz merged 1 commit intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
There was a problem hiding this comment.
The random result is in a range of [min, max)
python/paddle/tensor/random.py
Outdated
There was a problem hiding this comment.
这个是说seed设置成0的时候,用paddle.seed设置的全局随机数种子来生成随机数吧。
0 means use a seed generated by the system. 没表述清楚。
There was a problem hiding this comment.
done, 更新了seed参数的说明
There was a problem hiding this comment.
Please refer to other inplace operator's implementation, under normal situation, it can be shared with files of non-inplace, so no need to add uniform_random_inplace_op.cc, uniform_random_inplace_op.cu and uniform_random_inplace_op_xpu.cc
There was a problem hiding this comment.
Because the parameters between paddle.uniform and paddle.Tensor.uniform_ are different, non-inplace version Uniform Kernel can not be directly reused.
python/paddle/tensor/random.py
Outdated
There was a problem hiding this comment.
paddle can generate inplace function in Python, please refer to python/paddle/fluid/layers/ops.py and python/paddle/fluid/layers/layer_function_generator.py
b7a3f52 to
4a08853
Compare
4a08853 to
1614608
Compare
PR types
New features
PR changes
APIs
Describe
Add a new api Tensor.uniform_, which is the inplace version of api paddle.uniform.