Skip to content

Commit 041de79

Browse files
committed
Fix numel use in helpers for checkpoint remap
1 parent 2054f11 commit 041de79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timm/models/_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def remap_state_dict(
9595
"""
9696
out_dict = {}
9797
for (ka, va), (kb, vb) in zip(model.state_dict().items(), state_dict.items()):
98-
assert va.numel == vb.numel, f'Tensor size mismatch {ka}: {va.shape} vs {kb}: {vb.shape}. Remap failed.'
98+
assert va.numel() == vb.numel(), f'Tensor size mismatch {ka}: {va.shape} vs {kb}: {vb.shape}. Remap failed.'
9999
if va.shape != vb.shape:
100100
if allow_reshape:
101101
vb = vb.reshape(va.shape)

0 commit comments

Comments
 (0)