Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Courtesy-Xs committed Dec 6, 2022
1 parent fbaafab commit ad6f08d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/paddle/tensor/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ def diagflat(x, offset=0, name=None):
return _C_ops.diag(y, offset, padding_value)

if _in_legacy_dygraph():
if len(x.shape) <= 1:
if len(x.shape) == 1:
return _legacy_C_ops.diag_v2(
x, "offset", offset, "padding_value", padding_value
)
Expand Down

0 comments on commit ad6f08d

Please sign in to comment.