Skip to content

Commit

Permalink
Pass use_reentrant for checkpoint (#8180)
Browse files Browse the repository at this point in the history
  • Loading branch information
kit1980 authored Dec 22, 2023
1 parent 26fb5ef commit ae6b134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchvision/models/densenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def call_checkpoint_bottleneck(self, input: List[Tensor]) -> Tensor:
def closure(*inputs):
return self.bn_function(inputs)

return cp.checkpoint(closure, *input)
return cp.checkpoint(closure, *input, use_reentrant=False)

@torch.jit._overload_method # noqa: F811
def forward(self, input: List[Tensor]) -> Tensor: # noqa: F811
Expand Down

0 comments on commit ae6b134

Please sign in to comment.