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

对于min、max等归约算法返回值的建议。 #41247

Closed
hanjr92 opened this issue Apr 1, 2022 · 5 comments
Closed

对于min、max等归约算法返回值的建议。 #41247

hanjr92 opened this issue Apr 1, 2022 · 5 comments
Labels
status/close 已关闭

Comments

@hanjr92
Copy link

hanjr92 commented Apr 1, 2022

欢迎您对PaddlePaddle提出建议,非常感谢您对PaddlePaddle的贡献!
在留下您的建议时,辛苦您同步提供如下信息:

  • 版本、环境信息
    1)PaddlePaddle版本:2.0.0
    2)CPU/GPU:cpu
    3)系统环境:windows 10
  • 复现信息:对比tensorflow、pytorch、mindspore、paddle四个框架的max、min这类的归约函数,发现了一个问题。
    image
    对于归约算法,如果不指定轴,最终获取的应该时一个标量,事实上其他三个框架最终结果也都是标量,而只有paddle给出的是一个一维张量。
  • 建议描述:我建议归约结果如果是标量的时候应当让shape = [], 这样有利于后续的其他计算,因为我在使用paddle的时候发现,当我想把多个张量的max结果stack起来的时候,会生成一个二维张量,而其他框架会生成一个一维张量,在后续的模型计算时,我总要将二维张量reshape操作,才能符合预期shape。希望能把min、max、std、sum、mean这类归约算法结果返回标量的时候,返回一个shape = [] 的结果,而不是返回一个shape = [1]的 一维张量,符合使用习惯。
@paddle-bot-old
Copy link

paddle-bot-old bot commented Apr 1, 2022

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网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!

@jim19930609
Copy link
Contributor

您好,非常感谢您对API设计方面的改进建议!问题已经转发给Paddle内部负责API的同学进行评估

@hanjr92
Copy link
Author

hanjr92 commented Apr 1, 2022

image
除此之外,我感觉paddle是不是对于张量的维度定义稍微有一点点问题,虽然在大多数情况下都不影响计算,但是一旦涉及标量stack或者标量升维的时候,总会出现点问题。。。。如上图所示,只有paddle在对标量 1 初始化的时候会返回一个一维张量,奇怪是 对np.array(1)进行初始化的时候,又能正确的返回标量张量。。。。这样的处理有些时候让人很迷惑 = =! @jim19930609

@hanjr92
Copy link
Author

hanjr92 commented Apr 8, 2022

hello?这个第二个问题,不知道有没有给paddle的伙伴们反馈啊。@jim19930609

@jim19930609 jim19930609 removed their assignment May 21, 2022
@zhwesky2010
Copy link
Contributor

@hanjr92
你好,飞桨将于2.5版本全面支持0维Tensor,上述反馈的0D问题也将同时解决。

欢迎试用并安装develop 版本的paddle whl包,将体验最新的0维特性:https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html
安装命令:
pip install paddlepaddle-gpu==0.0.0.post112 -f https://www.paddlepaddle.org.cn/whl/linux/gpu/develop.html


Hello, Paddle will fully support the 0-dimensional Tensor in version 2.5, and the 0D issue will also be resolved at the same time.
Welcome to try and install the develop version of the paddle whl package, and you will experience the latest 0-dimensional features: https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux -pip.html
Install Command:
pip install paddlepaddle-gpu==0.0.0.post112 -f https://www.paddlepaddle.org.cn/whl/linux/gpu/develop.html

@paddle-bot paddle-bot bot added the status/close 已关闭 label May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/close 已关闭
Projects
None yet
Development

No branches or pull requests

3 participants