Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add uniform op doc #2439

Merged
merged 3 commits into from
Aug 22, 2020
Merged

Conversation

pangyoki
Copy link
Contributor

@pangyoki pangyoki commented Aug 20, 2020

Add uniform op under paddle/tensor/random.py. Including cn and en doc.

中文

屏幕快照 2020-08-21 下午3 47 05
屏幕快照 2020-08-21 下午3 48 23

英文

屏幕快照 2020-08-21 下午3 49 29
屏幕快照 2020-08-21 下午3 50 32

@pangyoki pangyoki force-pushed the add_uniform_doc_branch branch from 756559a to 90423dc Compare August 21, 2020 06:00

参数:
- **shape** (list|tuple|Tensor) - 生成的随机Tensor的形状。如果 ``shape`` 是list、tuple,则其中的元素可以是int,或者是形状为[1]且数据类型为int32、int64的Tensor。如果 ``shape`` 是Tensor,则是数据类型为int32、int64的1-D Tensor。
- **dtype** (str|np.dtype|core.VarDesc.VarType, 可选) - 输出Tensor的数据类型,支持float32、float64。默认值为float32。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no core.VarDesc.VarType

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# [[-0.8517412, -0.4006908, 0.2551912 ],
# [ 0.3364414, 0.36278176, -0.16085452]]

paddle.enable_static()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要这一行.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for doc.
A small question is that when dtype is None, should we use global dtype, which is managed by get_default_dtype and set_default_dtype

@zhiqiu zhiqiu merged commit 83d775f into PaddlePaddle:develop Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants