@@ -38,9 +38,7 @@ and the rest of the library
38
38
__all__ += [
39
39
" dpnp_atleast_2d" ,
40
40
" dpnp_atleast_3d" ,
41
- " dpnp_expand_dims" ,
42
41
" dpnp_repeat" ,
43
- " dpnp_reshape" ,
44
42
]
45
43
46
44
@@ -104,35 +102,6 @@ cpdef utils.dpnp_descriptor dpnp_atleast_3d(utils.dpnp_descriptor arr):
104
102
return arr
105
103
106
104
107
- cpdef utils.dpnp_descriptor dpnp_expand_dims(utils.dpnp_descriptor in_array, axis):
108
- axis_tuple = utils._object_to_tuple(axis)
109
- result_ndim = len (axis_tuple) + in_array.ndim
110
-
111
- if len (axis_tuple) == 0 :
112
- axis_ndim = 0
113
- else :
114
- axis_ndim = max (- min (0 , min (axis_tuple)), max (0 , max (axis_tuple))) + 1
115
-
116
- axis_norm = utils._object_to_tuple(utils.normalize_axis(axis_tuple, result_ndim))
117
-
118
- if axis_ndim - len (axis_norm) > in_array.ndim:
119
- utils.checker_throw_axis_error(" dpnp_expand_dims" , " axis" , axis, axis_ndim)
120
-
121
- if len (axis_norm) > len (set (axis_norm)):
122
- utils.checker_throw_value_error(" dpnp_expand_dims" , " axis" , axis, " no repeated axis" )
123
-
124
- cdef shape_type_c shape_list
125
- axis_idx = 0
126
- for i in range (result_ndim):
127
- if i in axis_norm:
128
- shape_list.push_back(1 )
129
- else :
130
- shape_list.push_back(in_array.shape[axis_idx])
131
- axis_idx = axis_idx + 1
132
-
133
- return dpnp_reshape(in_array, shape_list)
134
-
135
-
136
105
cpdef utils.dpnp_descriptor dpnp_repeat(utils.dpnp_descriptor array1, repeats, axes = None ):
137
106
cdef DPNPFuncType param1_type = dpnp_dtype_to_DPNPFuncType(array1.dtype)
138
107
@@ -165,17 +134,3 @@ cpdef utils.dpnp_descriptor dpnp_repeat(utils.dpnp_descriptor array1, repeats, a
165
134
c_dpctl.DPCTLEvent_Delete(event_ref)
166
135
167
136
return result
168
-
169
-
170
- cpdef utils.dpnp_descriptor dpnp_reshape(utils.dpnp_descriptor array1, newshape, order = " C" ):
171
- # return dpnp.get_dpnp_descriptor(dpctl.tensor.usm_ndarray(newshape, dtype=numpy.dtype(array1.dtype).name, buffer=array1.get_pyobj()))
172
- # return dpnp.get_dpnp_descriptor(dpctl.tensor.reshape(array1.get_pyobj(), newshape))
173
- array1_obj = array1.get_array()
174
- array_obj = dpctl.tensor.reshape(array1_obj, newshape, order = order)
175
- return dpnp.get_dpnp_descriptor(dpnp_array(array_obj.shape,
176
- buffer = array_obj,
177
- order = order,
178
- device = array1_obj.sycl_device,
179
- usm_type = array1_obj.usm_type,
180
- sycl_queue = array1_obj.sycl_queue),
181
- copy_when_nondefault_queue = False )
0 commit comments