-
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
add_dtensor_from_fn_cn_doc #6130
Conversation
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
.. py:class:: paddle.distributed.dtensor_from_fn(fn,dist_attr,*args,**kwargs) | ||
|
||
通过传入的函数fn以及可能的参数*args,**kwargs构造一个tensor,将这个tensor传给shard_tensor |
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的实现过程,我们这里重点描述API的功能,比如:通过的paddle API(一般是Tensor创建类API)结合分布式属性创建一个带有分布式属性的Tensor。具体可以再思考完善下
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.
参考修改为:通过一个paddle API(一般是Tensor创建类的API)结合分布式属性dist_attr创建一个带有分布式属性的Tensor。
参数 | ||
::::::::: | ||
|
||
- **fn** - 类似empty/ones/zeros等任意函数 |
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.
先说是什么函数,再举例。比如:paddle公开的可创建Tensor的API。例如:paddle.empty
、paddle.ones
、paddle.zeros
等paddle API
这里的API应该是可跳转的链接
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.
修改完成,查找学习了rst文件插入外部链接的办法
|
||
- **fn** - 类似empty/ones/zeros等任意函数 | ||
- **dist_attr** (paddle.distributed.DistAttr) - 描述 Tensor 在 ProcessMesh 上的分布或切片方式。 | ||
- ***args** - 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.
“可能存在”有点奇怪,直接说fn函数的输入参数是不是就行,而且和下面的参数介绍要不要区分一下,fn函数的输入参数(Tuple形式),下面是Dict形式
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
…dd_dtensor_from_fn_cn_doc resolve issues raised by code review
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.
- 中英文之间务必加空格,我没有全部标出来,请检查~
- 在 PR描述里 可以加上相对应的英文文档PR
PADDLEPADDLE_PR=<PR_NUMBER>
,这样就可以预览代码示例了
|
||
.. py:class:: paddle.distributed.dtensor_from_fn(fn, dist_attr, *args, **kwargs) | ||
|
||
通过一个paddle API(一般是Tensor创建类的API)结合分布式属性dist_attr创建一个带有分布式属性的Tensor。 |
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.
中英文间需要保留空格,保证写作风格统一,也检查下其余的地方有没有类似的问题
通过一个paddle API(一般是Tensor创建类的API)结合分布式属性dist_attr创建一个带有分布式属性的Tensor。 | |
通过一个 paddle API(一般是 Tensor 创建类的 API)结合分布式属性 dist_attr 创建一个带有分布式属性的 Tensor。 |
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
@@ -0,0 +1,30 @@ | |||
.. _cn_api_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 和路径对齐
.. _cn_api_distributed_dtensor_from_fn: | |
.. _cn_api_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.
done
- **fn** - paddle公开的可创建Tensor的API。例如:`paddle.empty`_、`paddle.ones`_、`paddle.zeros`_等paddle API | ||
.. _paddle.empty:https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/creation.py | ||
.. _paddle.ones:https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/creation.py | ||
.. _paddle.zeros:https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/creation.py |
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 文档也请用中文的,即
- **fn** - paddle公开的可创建Tensor的API。例如:`paddle.empty`_、`paddle.ones`_、`paddle.zeros`_等paddle API | |
.. _paddle.empty:https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/creation.py | |
.. _paddle.ones:https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/creation.py | |
.. _paddle.zeros:https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/tensor/creation.py | |
- **fn** - paddle 公开的可创建 Tensor 的 API。例如: :ref:`cn_api_paddle_empty` 、 :ref:`cn_api_paddle_ones` 、:ref:`cn_api_paddle_zeros` 等 paddle API。 |
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
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.
LGTM
Add dtensor from fn cn doc
PADDLEPADDLE_PR=56565