未验证 提交 e2bc846f 编写于 作者: W Weilong Wu 提交者: GitHub

[Eager] Support test_label_smooth_functional switch to eager mode (#42366) (#42393)

上级 ebb94504
......@@ -1633,14 +1633,14 @@ def label_smooth(label, prior_dist=None, epsilon=0.1, name=None):
#[[[0.03333334 0.93333334 0.03333334]
# [0.93333334 0.03333334 0.93333334]]]
"""
if epsilon > 1. or epsilon < 0.:
raise ValueError("The value of epsilon must be between 0 and 1.")
if in_dygraph_mode():
return _C_ops.final_state_label_smooth(label, prior_dist,
float(epsilon))
if epsilon > 1. or epsilon < 0.:
raise ValueError("The value of epsilon must be between 0 and 1.")
if paddle.in_dynamic_mode():
elif paddle.in_dynamic_mode():
return _C_ops.label_smooth(label, prior_dist, 'epsilon', float(epsilon))
check_variable_and_dtype(label, 'label', ['float32', 'float64'],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册