-
Notifications
You must be signed in to change notification settings - Fork 777
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_dtensor_from_fn_cn_doc #6130
Changes from 1 commit
af186d6
4da3257
d8a23bb
a17bed7
8352690
1a35a33
5b1d7a8
8ffa05a
35b16b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.. _cn_api_distributed_dtensor_from_fn: | ||
|
||
dtensor_from_fn | ||
------------------------------- | ||
|
||
.. py:class:: paddle.distributed.dtensor_from_fn(fn,dist_attr,*args,**kwargs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 一般参数之间需要有个空格分割 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
通过传入的函数fn以及可能的参数*args,**kwargs构造一个tensor,将这个tensor传给shard_tensor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个描述是API的实现过程,我们这里重点描述API的功能,比如:通过的paddle API(一般是Tensor创建类API)结合分布式属性创建一个带有分布式属性的Tensor。具体可以再思考完善下 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 参考修改为:通过一个paddle API(一般是Tensor创建类的API)结合分布式属性dist_attr创建一个带有分布式属性的Tensor。 |
||
|
||
|
||
参数 | ||
::::::::: | ||
|
||
- **fn** - 类似empty/ones/zeros等任意函数 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 先说是什么函数,再举例。比如:paddle公开的可创建Tensor的API。例如: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 修改完成,查找学习了rst文件插入外部链接的办法 |
||
- **dist_attr** (paddle.distributed.DistAttr) - 描述 Tensor 在 ProcessMesh 上的分布或切片方式。 | ||
- ***args** - fn函数可能存在的参数 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. “可能存在”有点奇怪,直接说fn函数的输入参数是不是就行,而且和下面的参数介绍要不要区分一下,fn函数的输入参数(Tuple形式),下面是Dict形式 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
- ****kwargs** - fn函数可能存在的参数 | ||
|
||
|
||
返回 | ||
::::::::: | ||
带有分布式信息的 Tensor | ||
|
||
|
||
|
||
**代码示例** | ||
|
||
COPY-FROM: paddle.distributed.dtensor_from_fn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
该 api_label 和路径对齐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done