Skip to content

Commit ab4f655

Browse files
committed
MAINT: rm dead code
1 parent f01bf39 commit ab4f655

File tree

3 files changed

+3
-34
lines changed

3 files changed

+3
-34
lines changed

torch_np/_detail/_util.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -170,34 +170,6 @@ def typecast_tensors(tensors, target_dtype, casting):
170170
return tuple(cast_tensors)
171171

172172

173-
def axis_expand_func(func, tensor, axis, *args, **kwds):
174-
"""Generically handle axis arguments in reductions."""
175-
if axis is not None:
176-
if not isinstance(axis, (list, tuple)):
177-
axis = (axis,)
178-
axis = normalize_axis_tuple(axis, tensor.ndim)
179-
180-
if axis == ():
181-
newshape = expand_shape(tensor.shape, axis=0)
182-
tensor = tensor.reshape(newshape)
183-
axis = (0,)
184-
185-
result = func(tensor, axis=axis, *args, **kwds)
186-
187-
return result
188-
189-
190-
def axis_ravel_func(func, tensor, axis, *args, **kwds):
191-
"""Generically handle axis arguments in cumsum/cumprod."""
192-
if axis is not None:
193-
axis = normalize_axis_index(axis, tensor.ndim)
194-
195-
tensors, axis = axis_none_ravel(tensor, axis=axis)
196-
tensor = tensors[0]
197-
198-
result = func(tensor, axis=axis, *args, **kwds)
199-
200-
return result
201173

202174

203175
def _coerce_to_tensor(obj, dtype=None, copy=False, ndmin=0):

torch_np/_funcs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import torch
44

5-
from . import _detail as _impl
5+
from ._detail import _dtypes_impl, _util, _reductions as _impl
66
from . import _helpers
7-
from ._detail import _util
87
from ._normalizations import (
98
ArrayLike,
109
AxisLike,
@@ -15,7 +14,6 @@
1514
normalizer,
1615
)
1716

18-
_dtypes_impl = _impl._dtypes_impl
1917

2018
NoValue = _util.NoValue
2119

torch_np/_wrapper.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
import torch
1010

11-
from . import _detail as _impl
12-
from . import _dtypes, _funcs, _helpers
11+
from . import _dtypes
1312
from ._detail import _dtypes_impl, _util
1413
from ._ndarray import asarray
1514
from ._normalizations import (
@@ -1036,7 +1035,7 @@ def put_along_axis(arr: ArrayLike, indices: ArrayLike, values: ArrayLike, axis):
10361035
return None
10371036

10381037

1039-
# ### unqiue et al ###
1038+
# ### unique et al ###
10401039

10411040

10421041
@normalizer

0 commit comments

Comments
 (0)