@@ -126,22 +126,22 @@ cpdef utils.dpnp_descriptor dpnp_expand_dims(utils.dpnp_descriptor in_array, axi
126
126
return result
127
127
128
128
129
- cpdef dparray dpnp_repeat(utils.dpnp_descriptor array1, repeats, axes = None ):
129
+ cpdef utils.dpnp_descriptor dpnp_repeat(utils.dpnp_descriptor array1, repeats, axes = None ):
130
130
cdef DPNPFuncType param1_type = dpnp_dtype_to_DPNPFuncType(array1.dtype)
131
131
132
132
cdef DPNPFuncData kernel_data = get_dpnp_function_ptr(DPNP_FN_REPEAT, param1_type, param1_type)
133
133
134
- result_type = dpnp_DPNPFuncType_to_dtype( < size_t > kernel_data.return_type)
135
- cdef long new_size = array1.size * repeats
136
- cdef dparray result = dparray((new_size, ), dtype = array1.dtype )
134
+ # ceate result array with type given by FPTR data
135
+ cdef shape_type_c result_shape = ( array1.size * repeats, )
136
+ cdef utils.dpnp_descriptor result = utils.create_output_descriptor(result_shape, kernel_data.return_type, None )
137
137
138
138
cdef fptr_dpnp_repeat_t func = < fptr_dpnp_repeat_t > kernel_data.ptr
139
139
func(array1.get_data(), result.get_data(), repeats, array1.size)
140
140
141
141
return result
142
142
143
143
144
- cpdef dparray dpnp_transpose(utils.dpnp_descriptor array1, axes = None ):
144
+ cpdef utils.dpnp_descriptor dpnp_transpose(utils.dpnp_descriptor array1, axes = None ):
145
145
cdef shape_type_c input_shape = array1.shape
146
146
cdef size_t input_shape_size = array1.ndim
147
147
cdef shape_type_c result_shape = shape_type_c(input_shape_size, 1 )
@@ -173,9 +173,8 @@ cpdef dparray dpnp_transpose(utils.dpnp_descriptor array1, axes=None):
173
173
# get the FPTR data structure
174
174
cdef DPNPFuncData kernel_data = get_dpnp_function_ptr(DPNP_FN_TRANSPOSE, param1_type, param1_type)
175
175
176
- result_type = dpnp_DPNPFuncType_to_dtype(< size_t > kernel_data.return_type)
177
176
# ceate result array with type given by FPTR data
178
- cdef dparray result = dparray (result_shape, dtype = result_type )
177
+ cdef utils.dpnp_descriptor result = utils.create_output_descriptor (result_shape, kernel_data.return_type, None )
179
178
180
179
cdef fptr_custom_elemwise_transpose_1in_1out_t func = < fptr_custom_elemwise_transpose_1in_1out_t > kernel_data.ptr
181
180
# call FPTR function
0 commit comments