Skip to content

Commit

Permalink
chore: reduce typechecked warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
supersergiy authored and nkemnitz committed Jul 8, 2024
1 parent f8df50e commit 4d6fbbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions zetta_utils/tensor_ops/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def int_divide(data: TensorTypeVar, value) -> TensorTypeVar: # pragma: no cover


@builder.register("unsqueeze")
@typechecked
@supports_dict
@typechecked
def unsqueeze(
data: TensorTypeVar, dim: Union[SupportsIndex, Sequence[SupportsIndex]] = 0
) -> TensorTypeVar:
Expand All @@ -131,8 +131,8 @@ def unsqueeze(


@builder.register("squeeze")
@typechecked
@supports_dict
@typechecked
def squeeze(
data: TensorTypeVar,
dim: Optional[Union[SupportsIndex, Sequence[SupportsIndex]]] = None,
Expand Down Expand Up @@ -279,8 +279,8 @@ def _validate_interpolation_setting(


@builder.register("unsqueeze_to")
@typechecked
@supports_dict
@typechecked
def unsqueeze_to(
data: TensorTypeVar,
ndim: Optional[int],
Expand All @@ -301,8 +301,8 @@ def unsqueeze_to(


@builder.register("squeeze_to")
@typechecked
@supports_dict
@typechecked
def squeeze_to(
data: TensorTypeVar,
ndim: Optional[int],
Expand All @@ -328,8 +328,8 @@ def squeeze_to(


@builder.register("interpolate")
@typechecked
@supports_dict
@typechecked
def interpolate( # pylint: disable=too-many-locals
data: TensorTypeVar,
size: Optional[Sequence[int]] = None,
Expand Down Expand Up @@ -509,8 +509,8 @@ def _interpolate_segmentation_with_tinybrain(


@builder.register("compare")
@typechecked
@supports_dict
@typechecked
def compare(
data: TensorTypeVar,
mode: CompareMode,
Expand Down Expand Up @@ -565,8 +565,8 @@ def compare(


@builder.register("crop")
@typechecked
@supports_dict
@typechecked
def crop(
data: TensorTypeVar,
crop: Sequence[int], # pylint: disable=redefined-outer-name
Expand All @@ -593,8 +593,8 @@ def crop(


@builder.register("crop_center")
@typechecked
@supports_dict
@typechecked
def crop_center(
data: TensorTypeVar,
size: Sequence[int], # pylint: disable=redefined-outer-name
Expand Down Expand Up @@ -636,8 +636,8 @@ def clone(


@builder.register("tensor_op_chain")
@typechecked
@supports_dict
@typechecked
def tensor_op_chain(
data: TensorTypeVar, steps: Sequence[Callable[[TensorTypeVar], TensorTypeVar]]
) -> TensorTypeVar: # pragma: no cover
Expand All @@ -648,8 +648,8 @@ def tensor_op_chain(


@builder.register("abs")
@typechecked
@supports_dict
@typechecked
def abs( # pylint: disable=redefined-builtin
data: TensorTypeVar,
) -> TensorTypeVar: # pragma: no cover
Expand All @@ -660,8 +660,8 @@ def abs( # pylint: disable=redefined-builtin


@builder.register("pad_center_to")
@typechecked
@supports_dict
@typechecked
def pad_center_to(
data: TensorTypeVar,
shape: Sequence[int],
Expand Down
2 changes: 1 addition & 1 deletion zetta_utils/tensor_ops/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def to_float32(data: TensorTypeVar) -> TensorTypeVar:


@builder.register("to_uint8")
@typechecked
@supports_dict
@typechecked
def to_uint8(data: TensorTypeVar) -> TensorTypeVar:
"""Convert the given tensor to uint8.
Expand Down

0 comments on commit 4d6fbbf

Please sign in to comment.