Skip to content

Commit b50f149

Browse files
remove numpy.typing
1 parent 80023c8 commit b50f149

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

.github/workflows/weekly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
include:
1616
- python_version: "3.9"
17-
override_requirements: "numpy==1.19.0"
17+
override_requirements: "numpy==1.19.1"
1818
- python_version: "3.9"
1919
override_requirements: "numpy==1.20.0"
2020
- python_version: "3.9"

nncf/common/tensor_statistics/collectors.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from typing import Any, Deque, Dict, List, Optional, Tuple, Union, cast
1616

1717
import numpy as np
18-
from numpy.typing import NDArray
1918

2019
from nncf.common.tensor import NNCFTensor
2120
from nncf.common.tensor import TensorType
@@ -318,7 +317,7 @@ class MedianMADStatisticCollector(OfflineTensorStatisticCollector):
318317
Collector estimates median and median absolute deviation (MAD).
319318
"""
320319

321-
def _prepare_statistics(self) -> Tuple[NDArray[Any], NDArray[Any]]:
320+
def _prepare_statistics(self) -> Tuple[np.ndarray, np.ndarray]:
322321
per_channel_history = get_per_channel_history(
323322
self._samples, cast(List[int], self._reduction_shape), discard_zeros=True
324323
)

nncf/common/tensor_statistics/reduction.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from typing import Any, Deque, List, Tuple
1313

1414
import numpy as np
15-
from numpy.typing import NDArray
1615

1716

1817
def get_channel_count_and_dim_idx(scale_shape: List[int]) -> Tuple[int, int]:
@@ -25,7 +24,7 @@ def get_channel_count_and_dim_idx(scale_shape: List[int]) -> Tuple[int, int]:
2524
return channel_count, channel_dim_idx
2625

2726

28-
def split_into_channels(input_: NDArray[Any], scale_shape: List[int]) -> List[NDArray[Any]]:
27+
def split_into_channels(input_: np.ndarray, scale_shape: List[int]) -> List[np.ndarray]:
2928
channel_count, channel_dim_idx = get_channel_count_and_dim_idx(scale_shape)
3029
channel_first_tensor = np.moveaxis(input_, channel_dim_idx, 0)
3130
if channel_count == 1:
@@ -61,7 +60,7 @@ def get_per_channel_history(
6160
return per_channel_history
6261

6362

64-
def np_percentile_reduce_like(input_: NDArray[Any], ref_tensor_shape: Tuple[int], q: float) -> NDArray[Any]:
63+
def np_percentile_reduce_like(input_: np.ndarray, ref_tensor_shape: Tuple[int], q: float) -> np.ndarray:
6564
numel = np.prod(ref_tensor_shape)
6665
if numel == 1:
6766
return np.array([np.percentile(input_, q)])

0 commit comments

Comments
 (0)