Paddle numeric_limits phi::dtype::float16

wpx232ag  于 5个月前  发布在  其他
关注(0)|答案(4)|浏览(44)

bug描述 Describe the Bug

Paddle/paddle/phi/common/float16.h

Line 1032 in 746b774

| | structnumeric_limitsphi::dtype::float16 { |

这里实现了phi::dtype::float16的numeric_limits类的实现,但是我在调用该类时返回的eps值为0.0001221,而通过np.finfo(np.float16).eps获得到的值为0.000977,两者结果并不相同

其他补充信息 Additional Supplementary Information

No response

neekobn8

neekobn81#

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

9rbhqvlz

9rbhqvlz2#

Paddle/paddle/phi/common/float16.h

Lines 1031 to 1084 in 746b774

| | template<> |
| | structnumeric_limitsphi::dtype::float16 { |
| | staticconstbool is_specialized = true; |
| | staticconstbool is_signed = true; |
| | staticconstbool is_integer = false; |
| | staticconstbool is_exact = false; |
| | staticconstbool has_infinity = true; |
| | staticconstbool has_quiet_NaN = true; |
| | staticconstbool has_signaling_NaN = true; |
| | staticconst float_denorm_style has_denorm = denorm_present; |
| | staticconstbool has_denorm_loss = false; |
| | staticconst std::float_round_style round_style = std::round_to_nearest; |
| | staticconstbool is_iec559 = false; |
| | staticconstbool is_bounded = false; |
| | staticconstbool is_modulo = false; |
| | staticconstint digits = 11; |
| | staticconstint digits10 = 3; |
| | staticconstint max_digits10 = 5; |
| | staticconstint radix = 2; |
| | staticconstint min_exponent = -13; |
| | staticconstint min_exponent10 = -4; |
| | staticconstint max_exponent = 16; |
| | staticconstint max_exponent10 = 4; |
| | staticconstbool traps = true; |
| | staticconstbool tinyness_before = false; |
| | |
| | HOSTDEVICE staticphi::dtype::float16(min)() { |
| | returnphi::dtype::raw_uint16_to_float16(0x400); |
| | } |
| | HOSTDEVICE static phi::dtype::float16 lowest() { |
| | returnphi::dtype::raw_uint16_to_float16(0xfbff); |
| | } |
| | HOSTDEVICE staticphi::dtype::float16(max)() { |
| | returnphi::dtype::raw_uint16_to_float16(0x7bff); |
| | } |
| | HOSTDEVICE static phi::dtype::float16 epsilon() { |
| | returnphi::dtype::raw_uint16_to_float16(0x0800); |
| | } |
| | HOSTDEVICE static phi::dtype::float16 round_error() { |
| | returnphi::dtype::float16(0.5); |
| | } |
| | HOSTDEVICE static phi::dtype::float16 infinity() { |
| | returnphi::dtype::raw_uint16_to_float16(0x7c00); |
| | } |
| | HOSTDEVICE static phi::dtype::float16 quiet_NaN() { |
| | returnphi::dtype::raw_uint16_to_float16(0x7e00); |
| | } |
| | HOSTDEVICE static phi::dtype::float16 signaling_NaN() { |
| | returnphi::dtype::raw_uint16_to_float16(0x7e00); |
| | } |
| | HOSTDEVICE static phi::dtype::float16 denorm_min() { |
| | returnphi::dtype::raw_uint16_to_float16(0x1); |
| | } |
| | }; |

emeijp43

emeijp433#

您好,我们跟进下这个问题,看是否需要对齐,感谢

zbq4xfa0

zbq4xfa04#

@Shixiaowei02 请问,这个是一个bug吗,还是说我做错实验了,获取的数据类型不对

相关问题