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

[Zero-Dim] Support output 0D for to_tensor. #52741

Merged
merged 34 commits into from
Apr 24, 2023

Conversation

zhengqiwen1997
Copy link
Contributor

@zhengqiwen1997 zhengqiwen1997 commented Apr 10, 2023

PR types

New features

PR changes

APIs

Description

pcard-66984
支持API输出0D Tensor:to_tensor。

@paddle-bot
Copy link

paddle-bot bot commented Apr 10, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@@ -58,6 +59,8 @@ def _apply_collective_grads(parameters, comm_group, bucket_size, scale=None):
for coalesced_grad, _, _ in coalesced_grads_and_vars:
# need to div nranks
if scale is not None:
if np.isscalar(scale) and not isinstance(scale, str):
Copy link
Contributor

Choose a reason for hiding this comment

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

elementwise_div应该已经支持了除以0D,这个保持原来的写法后面代码会挂不

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个可以保持原来的写法。

@@ -117,7 +117,7 @@ def recv_meta(self, group):

def _send_dims_shape_dtype(self, tensor, group):
# send len(shape)
dims = paddle.to_tensor(len(tensor.shape))
dims = paddle.to_tensor([len(tensor.shape)])
Copy link
Contributor

Choose a reason for hiding this comment

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

这个如果保持原来的写法,1D变0D后面会出错吗

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个先改成这样。

zhwesky2010
zhwesky2010 previously approved these changes Apr 19, 2023
dingjiaweiww
dingjiaweiww previously approved these changes Apr 21, 2023
XiaoguangHu01
XiaoguangHu01 previously approved these changes Apr 21, 2023
Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhengqiwen1997 zhengqiwen1997 changed the title [Zero-Dim] Support output 0D for to_tensor [Zero-Dim] Support output 0D for to_tensor. Apr 23, 2023
Copy link
Contributor

@sunzhongkai588 sunzhongkai588 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

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 merged commit 81fb7df into PaddlePaddle:develop Apr 24, 2023
lijialin03 pushed a commit to lijialin03/Paddle that referenced this pull request Apr 25, 2023
* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* test=allcase

* fix doc erros, test=allcase
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.

None yet

6 participants