Skip to content

Commit 7c5bb69

Browse files
committed
Update for loading MetaTensor
Signed-off-by: Eric Kerfoot <[email protected]>
1 parent d6152a3 commit 7c5bb69

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

monai/data/meta_tensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,4 +609,5 @@ def print_verbose(self) -> None:
609609
print(self.meta.__repr__())
610610

611611

612-
torch.serialization.add_safe_globals([MetaTensor])
612+
if hasattr(torch.serialization,"add_safe_globals"):
613+
torch.serialization.add_safe_globals([MetaTensor])

0 commit comments

Comments
 (0)