Skip to content

Commit 233cf57

Browse files
committed
fast path improvement
1 parent a6c040e commit 233cf57

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dpnp/dpnp_utils/dpnp_utils_pad.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def _pad_simple(array, pad_width, fill_value=None):
276276
277277
Parameters
278278
----------
279-
array : ndarray
279+
array : dpnp.ndarray
280280
Array to grow.
281281
pad_width : sequence of tuple[int, int]
282282
Pad width on both sides for each dimension in `arr`.
@@ -286,8 +286,8 @@ def _pad_simple(array, pad_width, fill_value=None):
286286
287287
Returns
288288
-------
289-
padded : ndarray
290-
The padded array with the same dtype as`array`. Its order will default
289+
padded : dpnp.ndarray
290+
The padded array with the same dtype as `array`. Its order will default
291291
to C-style if `array` is not F-contiguous.
292292
original_area_slice : tuple
293293
A tuple of slices pointing to the area of the original array.
@@ -299,7 +299,7 @@ def _pad_simple(array, pad_width, fill_value=None):
299299
left + size + right
300300
for size, (left, right) in zip(array.shape, pad_width)
301301
)
302-
order = "F" if array.flags.fnc else "C" # Fortran and not also C-order
302+
order = "F" if array.flags.fnc else "C"
303303
padded = dpnp.empty(
304304
new_shape,
305305
dtype=array.dtype,
@@ -598,7 +598,7 @@ def _view_roi(array, original_area_slice, axis):
598598
599599
Returns
600600
-------
601-
roi : ndarray
601+
roi : dpnp.ndarray
602602
The region of interest of the original `array`.
603603
604604
"""
@@ -679,7 +679,7 @@ def dpnp_pad(array, pad_width, mode="constant", **kwargs):
679679
if (
680680
dpnp.isscalar(values)
681681
and values == 0
682-
and (array.ndim == 1 or array.size < 4e6)
682+
and (array.ndim == 1 or array.size < 3e7)
683683
):
684684
# faster path for 1d arrays or small n-dimensional arrays
685685
return _pad_simple(array, pad_width, 0)[0]

0 commit comments

Comments
 (0)