Skip to content

Commit

Permalink
Ref: Cleanup imports
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Jan 4, 2025
1 parent 3dcd84e commit 8da3ae3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions phiml/math/_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 8da3ae3

Please sign in to comment.