Skip to content

Commit bb20577

Browse files
authored
enable use_checkpoint flag for Attention Block (#153)
1 parent 581a7d9 commit bb20577

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchcfm/models/unet/unet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def __init__(
270270
self.proj_out = zero_module(conv_nd(1, channels, channels, 1))
271271

272272
def forward(self, x):
273-
return checkpoint(self._forward, (x,), self.parameters(), True)
273+
return checkpoint(self._forward, (x,), self.parameters(), self.use_checkpoint)
274274

275275
def _forward(self, x):
276276
b, c, *spatial = x.shape

0 commit comments

Comments
 (0)