Paddle Segfault on trivial transpose

bogh5gae  于 2022-04-21  发布在  Java
关注(0)|答案(3)|浏览(168)

System information

-PaddlePaddle version 2.1.1
-CPU: including CPUMKL/OpenBlas/MKLDNN version
-GPU: not used
-OS Platform and Distribution: Mac OS 10.15
-Python version: 3.9.0
Note: You can get most of the information by running summary_env.py.

To Reproduce

See code below. Paddlepaddle doesn't handle zero-dimensional tensors (same issue as in mxnet v1, now fixed)

Describe your current behavior

Code segfaults.

[1]    71657 segmentation fault  ipython

Code to reproduce the issue

import paddle

paddle.zeros([]).transpose([]) # should return 0-dimensional tensor with 1 element, basically transpose should do nothing

paddle.zeros([]).reshape([]) # should return 0-dimensional tensor with 1 element, basically reshape should do nothing

Other info / logs

Support for zero-dimensional tensor is a hard requirement for inclusion for einops support.

Currently paddlepaddle can't pass the tests due to this issue

dba5bblo

dba5bblo1#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

kxe2p93d

kxe2p93d2#

@arogozhnikov thanks for providing details about processing zero-dimensional tensor in transpose (reshape). We will upgrade the ability of processing zero-dimensional tensor in future. :)

pdtvr36n

pdtvr36n3#

Hi, @joey12300. I am also very interested in intergrade paddle to einops. paddle.zeros([]).transpose([]) seems fixed in paddlepaddle==2.2.0, but paddle.zeros([]).reshape([]) still get error:

ValueError: (InvalidArgument) The parameter 'shape' in ReshapeOp must be set. But received 'shape' is empty.
  [Hint: Expected !shape.empty() == true, but received !shape.empty():0 != true:1.] (at /paddle/paddle/fluid/operators/reshape_op.cc:135)
  [operator < reshape2 > error]

相关问题