-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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] reshape/reshape_/reverse 0D support #49357
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
self.assertEqual(out.shape, [1]) | ||
self.assertEqual(out.grad.shape, [1]) | ||
|
||
new_shape = [paddle.to_tensor(-1), paddle.to_tensor(1)] |
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.
python/paddle/fluid/tests/unittests/xpu/test_zero_dim_tensor_xpu.py
Outdated
Show resolved
Hide resolved
python/paddle/fluid/tests/unittests/xpu/test_zero_dim_tensor_xpu.py
Outdated
Show resolved
Hide resolved
python/paddle/tensor/manipulation.py
Outdated
The data type is ``int32`` . If ``shape`` is a list or tuple, the elements of it should be integers or Tensors with shape [1]. | ||
If ``shape`` is an Tensor, it should be an 1-D Tensor . | ||
The data type is ``int32`` . If ``shape`` is a list or tuple, the elements of it should be integers or Tensors with shape []. | ||
If ``shape`` is an Tensor, it should be an 0-D 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.
就是如果是list(Tensor),其每个元素应该是一个标量,就应该支持0D Tensor的list。
如果是Tensor,其应该对应一个list,这个时候还是1D 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.
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
API文档这里,建议像目前这样写明白多少D对用户会更清楚些 |
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
PR types
Others
PR changes
Others
Describe
add npu/mlu/custom_cpu unittest PaddleCustomDevice#319
reshape 0d tensor doc update docs#5548