未验证 提交 d5b55112 编写于 作者: R Ryan 提交者: GitHub

Comment: float32 => float16; test=docoument_fix (#50156)

test=docoument_fix
上级 8907cdca
......@@ -700,7 +700,7 @@ def auto_cast(
with paddle.amp.auto_cast():
conv = conv2d(data)
print(conv.dtype) # paddle.float32
print(conv.dtype) # paddle.float16
with paddle.amp.auto_cast(enable=False):
conv = conv2d(data)
......@@ -714,11 +714,11 @@ def auto_cast(
b = paddle.rand([2,3])
with paddle.amp.auto_cast(custom_white_list={'elementwise_add'}):
c = a + b
print(c.dtype) # paddle.float32
print(c.dtype) # paddle.float16
with paddle.amp.auto_cast(custom_white_list={'elementwise_add'}, level='O2'):
d = a + b
print(d.dtype) # paddle.float32
print(d.dtype) # paddle.float16
"""
return amp_guard(enable, custom_white_list, custom_black_list, level, dtype)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册