Skip to content

PrintOP support more dtypes #58031

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

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/paddle/static/nn/control_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ def Print(
check_variable_and_dtype(
input,
'input',
['float32', 'float64', 'int32', 'int64', 'bool'],
['uint16', 'float16', 'float32', 'float64', 'int32', 'int64', 'bool'],
'paddle.static.Print',
)

Expand Down
4 changes: 2 additions & 2 deletions test/legacy_test/test_print_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def test_errors(self):
np.array([[-1]]), [[1]], paddle.CPUPlace()
)
self.assertRaises(TypeError, paddle.static.Print, x1)
# The input dtype of Print_op must be float32, float64, int32_t, int64_t or bool.
x2 = paddle.static.data(name='x2', shape=[4], dtype="float16")
# The input dtype of Print_op must be uint16, float16, float32, float64, int32_t, int64_t or bool.
x2 = paddle.static.data(name='x2', shape=[4], dtype="int8")
self.assertRaises(TypeError, paddle.static.Print, x2)


Expand Down