Skip to content

Commit d2132bb

Browse files
committed
Ignore warning farther up
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent 0aa92ac commit d2132bb

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

monai/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ 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"
4648
]
4749
for message in message_bodies_to_ignore:
4850
if message in record.getMessage():

monai/networks/nets/dints.py

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

3838

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

42-
@torch.jit.interface
43-
class CellInterface(torch.nn.Module):
44-
"""Abstract interface for Cell modules used in DiNTS."""
43+
def forward(self, x: torch.Tensor, weight: torch.Tensor | None) -> torch.Tensor: # type: ignore
44+
pass
4545

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

49-
@torch.jit.interface
50-
class StemInterface(torch.nn.Module):
51-
"""Abstract interface for Stem modules used in DiNTS."""
47+
@torch.jit.interface
48+
class StemInterface(torch.nn.Module):
49+
"""interface for torchscriptable Stem"""
5250

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

5654

5755
class StemTS(StemInterface):

0 commit comments

Comments
 (0)