Skip to content

Commit af8d622

Browse files
Copilotjustinchuby
andcommitted
Add early return for p==0 or not train in aten_feature_dropout
Co-authored-by: justinchuby <[email protected]>
1 parent 29f1968 commit af8d622

File tree

1 file changed

+3
-0
lines changed
  • onnxscript/function_libs/torch_lib/ops

1 file changed

+3
-0
lines changed

onnxscript/function_libs/torch_lib/ops/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3545,6 +3545,9 @@ def aten_feature_dropout(input: TFloat, p: FLOAT, train: BOOL) -> TFloat:
35453545
# Feature dropout applies dropout to entire feature maps/channels
35463546
# rather than individual elements
35473547

3548+
if p == 0 or not train:
3549+
return input
3550+
35483551
# Get input shape
35493552
input_shape = op.Shape(input)
35503553
ndim = op.Size(input_shape)

0 commit comments

Comments
 (0)