Skip to content

Commit

Permalink
Remove Ellipsis type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Dec 29, 2024
1 parent 128172e commit 37db76d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions phiml/math/_tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import traceback
import warnings
from contextlib import contextmanager
import typing
from types import EllipsisType
from typing import Union, TypeVar, Sequence, Any
from typing import Union, TypeVar, Sequence, Any, Literal

from dataclasses import dataclass
from typing import Tuple, Callable, List
Expand Down Expand Up @@ -2447,7 +2445,7 @@ def reshaped_native(value: Tensor,
def process_groups_for(shape: Shape, groups: Any) -> List[Shape]:
if callable(groups):
return list(groups(shape))
def process_group(g) -> Union[Shape, EllipsisType]:
def process_group(g): # returns Shape or Ellipsis
if g is None or (isinstance(g, tuple) and len(g) == 0):
return EMPTY_SHAPE
if isinstance(g, SHAPE_TYPES):
Expand Down

0 comments on commit 37db76d

Please sign in to comment.