@@ -104,7 +104,7 @@ def argsort(in_array1, axis=-1, kind=None, order=None):
104104 return numpy .argsort (in_array1 , axis , kind , order )
105105
106106
107- def partition (arr , kth , axis = - 1 , kind = 'introselect' , order = None ):
107+ def partition (x1 , kth , axis = - 1 , kind = 'introselect' , order = None ):
108108 """
109109 Return a partitioned copy of an array.
110110 For full documentation refer to :obj:`numpy.partition`.
@@ -115,12 +115,12 @@ def partition(arr, kth, axis=-1, kind='introselect', order=None):
115115 Input kth is supported as :obj:`int`.
116116 Parameters ``axis``, ``kind`` and ``order`` are supported only with default values.
117117 """
118- if not use_origin_backend ():
119- if not isinstance ( arr , dparray ):
120- pass
121- elif not isinstance (kth , int ):
118+
119+ x1_desc = dpnp . get_dpnp_descriptor ( x1 )
120+ if x1_desc :
121+ if not isinstance (kth , int ):
122122 pass
123- elif kth >= arr .shape [arr .ndim - 1 ] or arr .ndim + kth < 0 :
123+ elif kth >= x1_desc .shape [x1_desc .ndim - 1 ] or x1_desc .ndim + kth < 0 :
124124 pass
125125 elif axis != - 1 :
126126 pass
@@ -129,12 +129,12 @@ def partition(arr, kth, axis=-1, kind='introselect', order=None):
129129 elif order is not None :
130130 pass
131131 else :
132- return dpnp_partition (arr , kth , axis , kind , order )
132+ return dpnp_partition (x1_desc , kth , axis , kind , order )
133133
134- return call_origin (numpy .partition , arr , kth , axis , kind , order )
134+ return call_origin (numpy .partition , x1 , kth , axis , kind , order )
135135
136136
137- def searchsorted (arr , v , side = 'left' , sorter = None ):
137+ def searchsorted (x1 , x2 , side = 'left' , sorter = None ):
138138 """
139139 Find indices where elements should be inserted to maintain order.
140140 For full documentation refer to :obj:`numpy.searchsorted`.
@@ -146,27 +146,24 @@ def searchsorted(arr, v, side='left', sorter=None):
146146 Input side is supported only values ``left``, ``right``.
147147 Parameters ``sorter`` is supported only with default values.
148148 """
149- if not use_origin_backend ():
150- if not isinstance (arr , dparray ):
151- pass
152- elif not isinstance (v , dparray ):
153- pass
154- elif arr .ndim != 1 :
149+
150+ x1_desc = dpnp .get_dpnp_descriptor (x1 )
151+ x2_desc = dpnp .get_dpnp_descriptor (x2 )
152+ if 0 and x1_desc and x2_desc :
153+ if x1_desc .ndim != 1 :
155154 pass
156- elif arr .dtype != v .dtype :
155+ elif x1_desc .dtype != x2_desc .dtype :
157156 pass
158157 elif side not in ['left' , 'right' ]:
159158 pass
160159 elif sorter is not None :
161160 pass
162- elif arr .size < 2 :
163- pass
164- elif dpnp .sort (arr ) != arr :
161+ elif x1_desc .size < 2 :
165162 pass
166163 else :
167- return dpnp_searchsorted (arr , v , side = side )
164+ return dpnp_searchsorted (x1_desc , x2_desc , side = side )
168165
169- return call_origin (numpy .searchsorted , arr , v , side = side , sorter = sorter )
166+ return call_origin (numpy .searchsorted , x1 , x2 , side = side , sorter = sorter )
170167
171168
172169def sort (x1 , ** kwargs ):
0 commit comments