[export] avoid checks during tracing of export verification (#164219)

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164219
Approved by: https://github.com/Lucaskabela
This commit is contained in:
Animesh Jain
2025-09-30 21:46:56 +00:00
committed by PyTorch MergeBot
parent 99e28ffab3
commit adc11a7634

View File

@ -241,8 +241,11 @@ def _check_input_constraints_pre_hook(self, args, kwargs):
_check_inputs_match(args, kwargs, self._in_spec)
return
# NOTE: this call is Dynamo disabled, as it used to be
_check_input_constraints_for_module(self, args, kwargs)
# NOTE: for some reason, Dynamo is tracing into this, we should see why and
# put compile at the right place. Until then, we can skip the input
# constraint checks.
if not torch.compiler.is_dynamo_compiling():
_check_input_constraints_for_module(self, args, kwargs)
def _unlift_inputs_as_getattr(