Skip to content

Commit e2841b3

Browse files
pre-commit-ci[bot]milesial
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4a6a690 commit e2841b3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

monai/networks/nets/dints.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import datetime
1515
import warnings
16-
from typing import Optional
1716

1817
import numpy as np
1918
import torch
@@ -40,7 +39,7 @@
4039
class CellInterface(torch.nn.Module):
4140
"""interface for torchscriptable Cell"""
4241

43-
def forward(self, x: torch.Tensor, weight: Optional[torch.Tensor]) -> torch.Tensor: # type: ignore
42+
def forward(self, x: torch.Tensor, weight: torch.Tensor | None) -> torch.Tensor: # type: ignore
4443
pass
4544

4645

@@ -170,7 +169,7 @@ def __init__(self, c: int, ops: dict, arch_code_c=None):
170169
if arch_c > 0:
171170
self.ops.append(ops[op_name](c))
172171

173-
def forward(self, x: torch.Tensor, weight: Optional[torch.Tensor] = None):
172+
def forward(self, x: torch.Tensor, weight: torch.Tensor | None = None):
174173
"""
175174
Args:
176175
x: input tensor.
@@ -298,7 +297,7 @@ def __init__(
298297

299298
self.op = MixedOp(c, self.OPS, arch_code_c)
300299

301-
def forward(self, x: torch.Tensor, weight: Optional[torch.Tensor]) -> torch.Tensor:
300+
def forward(self, x: torch.Tensor, weight: torch.Tensor | None) -> torch.Tensor:
302301
"""
303302
Args:
304303
x: input tensor

0 commit comments

Comments
 (0)