From 8da3ae386f28af4d46c2856a297f7f15e6fcec64 Mon Sep 17 00:00:00 2001 From: Philipp Holl Date: Sat, 4 Jan 2025 14:30:59 +0100 Subject: [PATCH] Ref: Cleanup imports --- phiml/math/_shape.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/phiml/math/_shape.py b/phiml/math/_shape.py index 988c68e..9933d02 100644 --- a/phiml/math/_shape.py +++ b/phiml/math/_shape.py @@ -4,7 +4,7 @@ from dataclasses import dataclass, replace from functools import cached_property from numbers import Number -from typing import Tuple, Callable, List, Union, Any, Sequence, Optional, Dict, Protocol, runtime_checkable, Iterable +from typing import Tuple, Callable, List, Union, Any, Sequence, Optional, Dict, Protocol, runtime_checkable from .. import math @@ -2211,7 +2211,6 @@ def spatial(*args, **dims: Union[int, str, tuple, list, Shape, 'Tensor']) -> Sha Returns: `Shape` containing only dimensions of type spatial. """ - from .magic import Shaped if all(isinstance(arg, str) for arg in args) or dims: return _construct_shape(SPATIAL_DIM, *args, **dims) elif len(args) == 1 and isinstance(args[0], SHAPE_TYPES): @@ -2251,7 +2250,6 @@ def channel(*args, **dims: Union[int, str, tuple, list, Shape, 'Tensor']) -> Sha Returns: `Shape` containing only dimensions of type channel. """ - from .magic import Shaped if all(isinstance(arg, str) for arg in args) or dims: return _construct_shape(CHANNEL_DIM, *args, **dims) elif len(args) == 1 and isinstance(args[0], SHAPE_TYPES): @@ -2291,7 +2289,6 @@ def batch(*args, **dims: Union[int, str, tuple, list, Shape, 'Tensor']) -> Shape Returns: `Shape` containing only dimensions of type batch. """ - from .magic import Shaped if all(isinstance(arg, str) for arg in args) or dims: return _construct_shape(BATCH_DIM, *args, **dims) elif len(args) == 1 and isinstance(args[0], SHAPE_TYPES): @@ -2331,7 +2328,6 @@ def instance(*args, **dims: Union[int, str, tuple, list, Shape, 'Tensor']) -> Sh Returns: `Shape` containing only dimensions of type instance. """ - from .magic import Shaped if all(isinstance(arg, str) for arg in args) or dims: return _construct_shape(INSTANCE_DIM, *args, **dims) elif len(args) == 1 and isinstance(args[0], SHAPE_TYPES): @@ -2380,7 +2376,6 @@ def dual(*args, **dims: Union[int, str, tuple, list, Shape, 'Tensor']) -> Shape: Returns: `Shape` containing only dimensions of type dual. """ - from .magic import Shaped if all(isinstance(arg, str) for arg in args) or dims: return _construct_shape(DUAL_DIM, *args, **dims) elif len(args) == 1 and isinstance(args[0], SHAPE_TYPES):