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

[ Hackathon 3rd No.2 ] add paddle.iinfo #45321

Conversation

OccupyMars2025
Copy link
Contributor

@OccupyMars2025 OccupyMars2025 commented Aug 22, 2022

PR types

New features

PR changes

APIs

Describe

add new API paddle.iinfo
docs: PaddlePaddle/docs#5235

The previous PR is closed by myself:
#44797

@paddle-bot
Copy link

paddle-bot bot commented Aug 22, 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.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Aug 22, 2022
@OccupyMars2025 OccupyMars2025 deleted the hackathon-3rd-task1-add-finfo-and-task2-add-iinfo-version002 branch August 22, 2022 14:32
@paddle-bot
Copy link

paddle-bot bot commented Aug 22, 2022

很抱歉,经过我们的反复讨论,你的PR暂未达到合入标准,请阅读飞桨原生算子开发规范,你可以重新提交新的PR,我们先将此PR关闭,感谢你的贡献。
Sorry to inform you that through our discussion, your PR fails to meet the merging standard (Reference: Paddle Custom Operator Design Doc). You can also submit an new one. Thank you.

@OccupyMars2025 OccupyMars2025 restored the hackathon-3rd-task1-add-finfo-and-task2-add-iinfo-version002 branch August 22, 2022 14:33
@OccupyMars2025
Copy link
Contributor Author

中文文档地址:
PaddlePaddle/docs#5235

@cxxly
Copy link
Contributor

cxxly commented Sep 2, 2022

image

@OccupyMars2025
Copy link
Contributor Author

收到,谢谢,我再研究一下

@OccupyMars2025
Copy link
Contributor Author

OccupyMars2025 commented Sep 4, 2022

try to solve the error reported by PR-CI-Coverage

image

image

image

image

In my opinion, one and only one of "from .core_noavx import iinfo" and "from .core_avx import iinfo" will be covered, so I delete both of them because "from .core_avx import * " and " from .core_noavx import * " can do the same things.

@OccupyMars2025
Copy link
Contributor Author

@cxxly PR-CI-Coverage的报错已解决,麻烦再看一下

cxxly
cxxly previously approved these changes Sep 6, 2022
Copy link
Contributor

@cxxly cxxly left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 requested a review from Ligoml September 6, 2022 03:03
dtype: str, The string name of the argument dtype.

Raises:
ValueError: If the input "dtype" is not an integer paddle.dtype, it will raise an ValueError
Copy link
Contributor

Choose a reason for hiding this comment

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

raises删掉,这部分内容不建议在文档中体现,规范参考 API 文档书写规范

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

print(iinfo_uint8.min)
print(iinfo_uint8.max)
print(iinfo_uint8.bits)
print(iinfo_uint8.dtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

示例代码中,print的输出以注释的形式做展示,加在后面就好

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


paddle.iinfo is a function that returns an object that represents the numerical properties of
an integer paddle.dtype
(i.e. paddle.uint8, paddle.int8, paddle.int16, paddle.int32, and paddle.int64).
Copy link
Contributor

Choose a reason for hiding this comment

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

这里是不是和args中的dtype重复了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

paddle.iinfo is a function that returns an object that represents the numerical properties of
an integer paddle.dtype
(i.e. paddle.uint8, paddle.int8, paddle.int16, paddle.int32, and paddle.int64).
This is similar to numpy.iinfo.
Copy link
Contributor

Choose a reason for hiding this comment

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

给一个numpy.iinfo文档的超链接吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@OccupyMars2025
Copy link
Contributor Author

收到,我尽快处理

@OccupyMars2025
Copy link
Contributor Author

@Ligoml 我已经按要求修改完了,麻烦再看一下


paddle.iinfo is a function that returns an object that represents the numerical properties of
an integer paddle.dtype.
This is similar to [numpy.iinfo](https://numpy.org/doc/stable/reference/generated/numpy.iinfo.html#numpy-iinfo).
Copy link
Contributor

Choose a reason for hiding this comment

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

超链接的解析是rst的方式,建议修改一下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Args:
dtype(paddle.dtype): One of paddle.uint8, paddle.int8, paddle.int16, paddle.int32, and paddle.int64.

Returns:
Copy link
Contributor

Choose a reason for hiding this comment

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

image

这里如果想让四个属性分行展示,需要修改一下格式,参考:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@OccupyMars2025
Copy link
Contributor Author

收到,我尽快处理

@OccupyMars2025
Copy link
Contributor Author

done

Ligoml
Ligoml previously approved these changes Sep 7, 2022
Copy link
Contributor

@Ligoml Ligoml left a comment

Choose a reason for hiding this comment

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

LGTM for docs

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

@luotao1 luotao1 merged commit 40a0a46 into PaddlePaddle:develop Sep 8, 2022
Caozhou1995 pushed a commit to Caozhou1995/Paddle that referenced this pull request Sep 9, 2022
@OccupyMars2025
Copy link
Contributor Author

In file explorer, search "data_type.h" and "data_type.cc". After studying all the files, you may find a way to handle with paddle.float16, paddle.bfloat16, paddle.complex128 in paddle.finfo()

image

"C:\Users\Administrator\Desktop\contests\20220704_paddle_hackathon\Paddle\paddle\fluid\framework\data_type.h"
"C:\Users\Administrator\Desktop\contests\20220704_paddle_hackathon\Paddle\paddle\phi\core\utils\data_type.h"
"C:\Users\Administrator\Desktop\contests\20220704_paddle_hackathon\Paddle\paddle\phi\common\data_type.h"
"C:\Users\Administrator\Desktop\contests\20220704_paddle_hackathon\Paddle\paddle\phi\capi\include\data_type.h"
"C:\Users\Administrator\Desktop\contests\20220704_paddle_hackathon\Paddle\paddle\infrt\dialect\phi\data_type.h"
and so on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants