Skip to content

Commit 0aa92ac

Browse files
committed
Suppress warning for now, this needs to be fixed when removing Torchscript usage
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent 3bc1b85 commit 0aa92ac

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

monai/networks/nets/dints.py

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

3838

39-
class CellInterface(torch.nn.Module):
40-
"""Abstract interface for Cell modules used in DiNTS."""
39+
# TODO: added temporarily for PyTorch 2.14 warnings, remove when factoring out deprecated Torchscript components
40+
with warnings.catch_warnings(action="ignore"):
4141

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

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

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

49-
def forward(self, x: torch.Tensor) -> torch.Tensor: # type: ignore
50-
raise NotImplementedError
53+
def forward(self, x: torch.Tensor) -> torch.Tensor: # type: ignore
54+
pass
5155

5256

5357
class StemTS(StemInterface):

0 commit comments

Comments
 (0)