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 input 0D Tensor for sundary api #47734

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

zhwesky2010
Copy link
Contributor

@zhwesky2010 zhwesky2010 commented Nov 7, 2022

PR types

New features

PR changes

APIs

Describe

为无需测反向的这类API支持输入0D Tensor,例如判断类、属性等API,如下:

paddle.nn.functional.linear
paddle.is_complex
paddle.is_floating_point
paddle.is_integer
paddle.is_tensor
paddle.isfinite
paddle.isinf
paddle.isnan
paddle.isclose
paddle.clone
paddle.assign
paddle.Tensor.item
paddle.Tensor.tolist
paddle.Tensor.numpy
paddle.numel
paddle.rank
paddle.shape

@paddle-bot
Copy link

paddle-bot bot commented Nov 7, 2022

你的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.

XieYunshen
XieYunshen previously approved these changes Nov 7, 2022
]

binary_api_list_without_grad = [
{'func': paddle.pow, 'cls_method': '__pow__'},
{'func': paddle.add, 'cls_method': '__add__'},
{'func': paddle.subtract, 'cls_method': '__sub__'},
{'func': paddle.multiply, 'cls_method': '__mul__'},
{'func': paddle.divide, 'cls_method': '__div__'},
{'func': paddle.subtract, 'cls_method': '__sub__'},
Copy link
Contributor

Choose a reason for hiding this comment

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

why did paddle.subtract repeat 4 times, while paddle.add 2 times, what is the meaning of repeat in the list?

Copy link
Contributor

Choose a reason for hiding this comment

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

shall we add paddle.maximum and paddle.minimum ?

Copy link
Contributor Author

@zhwesky2010 zhwesky2010 Nov 8, 2022

Choose a reason for hiding this comment

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

目前只支持了部分二元,就是这个list中包含的。这两个还未支持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.

why did paddle.subtract repeat 4 times, while paddle.add 2 times, what is the meaning of repeat in the list?

Some mistake, have fixed it.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, thanks

{'func': paddle.equal, 'cls_method': '__eq__'},
{'func': paddle.not_equal, 'cls_method': '__ne__'},
{'func': paddle.greater_equal, 'cls_method': '__ge__'},
{'func': paddle.greater_than, 'cls_method': '__gt__'},
{'func': paddle.less_equal, 'cls_method': '__le__'},
{'func': paddle.less_than, 'cls_method': '__lt__'},
{'func': paddle.remainder, 'cls_method': '__mod__'},
paddle.mod,
paddle.floor_mod,
paddle.logical_and,
paddle.logical_or,
paddle.logical_xor,
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we add paddle.bitwise_and/or/xor ?

Copy link
Contributor Author

@zhwesky2010 zhwesky2010 Nov 8, 2022

Choose a reason for hiding this comment

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

已添加

Copy link
Contributor

@jeff41404 jeff41404 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 3198af2 into PaddlePaddle:develop Nov 8, 2022
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