Skip to content

Commit cf324ea

Browse files
committed
Fix grad checkpointing in focalnet
1 parent 848d200 commit cf324ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

timm/models/focalnet.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ def __init__(
266266
)
267267
for i in range(depth)])
268268

269+
@torch.jit.ignore
270+
def set_grad_checkpointing(self, enable=True):
271+
self.grad_checkpointing = enable
272+
269273
def forward(self, x):
270274
x = self.downsample(x)
271275
for blk in self.blocks:

0 commit comments

Comments
 (0)