Skip to content

Commit

Permalink
enable use_checkpoint flag for Attention Block (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhliu17 authored Dec 3, 2024
1 parent 581a7d9 commit bb20577
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchcfm/models/unet/unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def __init__(
self.proj_out = zero_module(conv_nd(1, channels, channels, 1))

def forward(self, x):
return checkpoint(self._forward, (x,), self.parameters(), True)
return checkpoint(self._forward, (x,), self.parameters(), self.use_checkpoint)

def _forward(self, x):
b, c, *spatial = x.shape
Expand Down

0 comments on commit bb20577

Please sign in to comment.