Skip to content

Commit 26f1fea

Browse files
committed
Test the impact of 4 to 1 checks in each module
[ghstack-poisoned]
1 parent e6b51d6 commit 26f1fea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

torch/nn/modules/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ def _call_impl(self, *args, **kwargs):
14951495
forward_call = (self._slow_forward if torch._C._get_tracing_state() else self.forward)
14961496
# If we don't have any hooks, we want to skip the rest of the logic in
14971497
# this function, and just call forward.
1498-
if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1498+
if not (self._forward_hooks
14991499
or _global_backward_pre_hooks or _global_backward_hooks
15001500
or _global_forward_hooks or _global_forward_pre_hooks):
15011501
return forward_call(*args, **kwargs)

0 commit comments

Comments
 (0)