Skip to content

Commit 8865c10

Browse files
committed
remove arange
1 parent 24da4fd commit 8865c10

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

Diff for: examples/transpose.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def np_transpose(arr):
5050

5151

5252
def initialize(np, row, col, dtype):
53-
arr = np.arange(row * col, dtype=dtype)
53+
arr = np.arange(0, row * col, dtype=dtype)
5454
return np.reshape(arr, (row, col))
5555

5656

Diff for: sharpy/__init__.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,6 @@ def _validate_device(device):
9696
raise ValueError(f"Invalid device string: {device}")
9797

9898

99-
def arange(start, stop=None, step=1, dtype=int64, device="", team=1):
100-
if stop is None:
101-
stop = start
102-
start = 0
103-
return ndarray(
104-
_csp.Creator.arange(
105-
start, stop, step, dtype, _validate_device(device), team
106-
)
107-
)
108-
109-
11099
for func in api.api_categories["Creator"]:
111100
FUNC = func.upper()
112101
if func == "full":
@@ -125,6 +114,10 @@ def arange(start, stop=None, step=1, dtype=int64, device="", team=1):
125114
exec(
126115
f"{func} = lambda shape, dtype=float64, device='', team=1: ndarray(_csp.Creator.full(shape, 0, dtype, _validate_device(device), team))"
127116
)
117+
elif func == "arange":
118+
exec(
119+
f"{func} = lambda start, end, step, dtype=int64, device='', team=1: ndarray(_csp.Creator.arange(start, end, step, dtype, _validate_device(device), team))"
120+
)
128121
elif func == "linspace":
129122
exec(
130123
f"{func} = lambda start, end, step, endpoint, dtype=float64, device='', team=1: ndarray(_csp.Creator.linspace(start, end, step, endpoint, dtype, _validate_device(device), team))"

0 commit comments

Comments
 (0)