Skip to content

Commit

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

Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: pytorch#96300
Approved by: https://github.com/bdhirsh
  • Loading branch information
ydwu4 committed Mar 11, 2023
1 parent eee647d commit a48652e
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 a48652e

Please sign in to comment.