Skip to content
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
3 changes: 0 additions & 3 deletions python/paddle/autograd/backward_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,6 @@ def _check_vjp_dynamic_shape(op, inputs):
for items in inputs:
for item in items:
if item.initialized() and -1 in item.shape:
warnings.warn(
f"[Prim] Decomp op does not support dynamic shape -1, but got shape {item.shape} in inputs of op {op.name()} . Prim will skip its vjp op."
)
return True


Expand Down
4 changes: 3 additions & 1 deletion python/paddle/nn/functional/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,9 @@ def get_attrs(prog, dropout_prob, is_test, seed):
dtype = x.dtype
keep_prob = 1 - p
if training:
if in_dynamic_or_pir_mode() and p == 1.0:
if in_dynamic_mode() and p == 1.0:
return paddle.scale(x, scale=0.0)
elif in_pir_mode() and isinstance(p, (float, int)) and p == 1.0:
return paddle.scale(x, scale=0.0)

scale_input = (
Expand Down