Skip to content

Commit

Permalink
Assert that there are no None arguments to backwards (#96300)
Browse files Browse the repository at this point in the history
This assert would have caught #96219

Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: #96300
Approved by: https://github.com/bdhirsh
  • Loading branch information
ezyang authored and pytorchmergebot committed Mar 9, 2023
1 parent bbe1b9b commit 30c4ea1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions torch/_functorch/aot_autograd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2356,6 +2356,7 @@ def backward(ctx, *flat_args):

def call_compiled_backward():
if CompiledFunction.compiled_bw is None:
assert all(a is not None for a in all_args)
if aot_config.dynamic_shapes:
all_args_list = list(all_args)
CompiledFunction.compiled_bw = create_aot_dispatcher_function(
Expand Down

0 comments on commit 30c4ea1

Please sign in to comment.