Skip to content

Commit 40ea29a

Browse files
committed
Fix again
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent e0b3c02 commit 40ea29a

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

monai/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ def filter(self, record):
4343
"class-based `config`",
4444
"pkg_resources",
4545
"Implicitly cleaning up",
46-
# TODO: added temporarily for PyTorch 2.14, remove when factoring out deprecated Torchscript components
47-
"torch.jit.interface"
4846
]
4947
for message in message_bodies_to_ignore:
5048
if message in record.getMessage():

monai/networks/nets/dints.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,23 @@
3636
__all__ = ["DiNTS", "TopologyConstruction", "TopologyInstance", "TopologySearch"]
3737

3838

39-
@torch.jit.interface
40-
class CellInterface(torch.nn.Module):
41-
"""interface for torchscriptable Cell"""
39+
# TODO: added temporarily for PyTorch 2.14 warnings, remove when factoring out deprecated Torchscript components
40+
with warnings.catch_warnings():
41+
warnings.simplefilter("ignore")
4242

43-
def forward(self, x: torch.Tensor, weight: torch.Tensor | None) -> torch.Tensor: # type: ignore
44-
pass
43+
@torch.jit.interface
44+
class CellInterface(torch.nn.Module):
45+
"""interface for torchscriptable Cell"""
4546

47+
def forward(self, x: torch.Tensor, weight: torch.Tensor | None) -> torch.Tensor: # type: ignore
48+
pass
4649

47-
@torch.jit.interface
48-
class StemInterface(torch.nn.Module):
49-
"""interface for torchscriptable Stem"""
50+
@torch.jit.interface
51+
class StemInterface(torch.nn.Module):
52+
"""interface for torchscriptable Stem"""
5053

51-
def forward(self, x: torch.Tensor) -> torch.Tensor: # type: ignore
52-
pass
54+
def forward(self, x: torch.Tensor) -> torch.Tensor: # type: ignore
55+
pass
5356

5457

5558
class StemTS(StemInterface):

0 commit comments

Comments
 (0)