From c1d80567086edea92ee4de6e95177bad6c79830f Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 22 Feb 2023 23:13:00 +0000 Subject: [PATCH] ignore type hints in jit Signed-off-by: Wenqi Li --- monai/networks/nets/dints.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/monai/networks/nets/dints.py b/monai/networks/nets/dints.py index 459c436b90..437789ef0c 100644 --- a/monai/networks/nets/dints.py +++ b/monai/networks/nets/dints.py @@ -18,6 +18,7 @@ import torch import torch.nn as nn import torch.nn.functional as F + from monai.networks.blocks.dints_block import ( ActiConvNormBlock, FactorizedIncreaseBlock, @@ -39,7 +40,7 @@ class CellInterface(torch.nn.Module): """interface for torchscriptable Cell""" - def forward(self, x: torch.Tensor, weight: torch.Tensor | None) -> torch.Tensor: # type: ignore + def forward(self, x: torch.Tensor, weight) -> torch.Tensor: # type: ignore pass @@ -675,9 +676,7 @@ def forward(self, x: list[torch.Tensor]) -> list[torch.Tensor]: for res_idx, activation in enumerate(self.arch_code_a[blk_idx].data): if activation: mod: CellInterface = self.cell_tree[str((blk_idx, res_idx))] - _out = mod.forward( - x=inputs[self.arch_code2in[res_idx]], weight=None - ) + _out = mod.forward(x=inputs[self.arch_code2in[res_idx]], weight=None) outputs[self.arch_code2out[res_idx]] = outputs[self.arch_code2out[res_idx]] + _out inputs = outputs