Skip to content

Commit 620ee3e

Browse files
committed
Use tuple instead of Union in isinstance check
1 parent ab71a49 commit 620ee3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

topoloss/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(
2525

2626
def check_layer_type(self, layer):
2727
assert isinstance(
28-
layer, Union[nn.Conv2d, nn.Linear]
28+
layer, (nn.Conv2d, nn.Linear)
2929
), f"Expect layer to be either nn.Conv2d or nn.Linear, but got: {type(layer)}"
3030

3131
def get_layerwise_topo_losses(self, model, do_scaling: bool = True) -> dict:

0 commit comments

Comments
 (0)