Skip to content

Commit a85aa25

Browse files
authored
Unskip tests2 (#686)
* unskip 194 tests
1 parent d3a1fe5 commit a85aa25

File tree

6 files changed

+38
-430
lines changed

6 files changed

+38
-430
lines changed

dpnp/backend/kernels/dpnp_krnl_indexing.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,23 @@ void dpnp_put_c(
254254
size_t* ind = reinterpret_cast<size_t*>(ind_in);
255255
_DataType* v = reinterpret_cast<_DataType*>(v_in);
256256

257+
if ((array_1 == nullptr) || (ind == nullptr) || (v == nullptr))
258+
{
259+
return;
260+
}
261+
262+
if (size_v == 0)
263+
{
264+
return;
265+
}
266+
257267
for (size_t i = 0; i < size; ++i)
258268
{
259269
for (size_t j = 0; j < size_ind; ++j)
260270
{
261-
if (i == ind[j])
271+
if (i == ind[j] || (i == (size + ind[j])))
262272
{
263273
array_1[i] = v[j % size_v];
264-
break;
265274
}
266275
}
267276
}

dpnp/dparray.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,12 @@ cdef class dparray:
833833
-------------------------------------------------------------------------
834834
"""
835835
836+
def cumprod(x1, **kwargs):
837+
return cumprod(x1, **kwargs)
838+
839+
def cumsum(x1, **kwargs):
840+
return cumsum(x1, **kwargs)
841+
836842
def prod(*args, **kwargs):
837843
"""
838844
Returns the prod along a given axis.

dpnp/dpnp_iface_indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def put(input, ind, v, mode='raise'):
404404
pass
405405
elif type(ind) != type(v):
406406
pass
407-
elif numpy.max(ind) > input.size:
407+
elif numpy.max(ind) >= input.size or numpy.min(ind) + input.size < 0:
408408
pass
409409
else:
410410
return dpnp_put(input, ind, v)

dpnp/linalg/dpnp_iface_linalg.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -382,21 +382,23 @@ def norm(input, ord=None, axis=None, keepdims=False):
382382
Norm of the matrix or vector(s).
383383
"""
384384

385-
is_input_dparray = isinstance(input, dparray)
386-
387-
if not use_origin_backend(input) and is_input_dparray:
388-
if keepdims is not False:
389-
checker_throw_value_error("norm", "keepdims", keepdims, False)
390-
if not isinstance(axis, int) and not isinstance(axis, tuple) and axis is not None:
391-
raise TypeError("'axis' must be None, an integer or a tuple of integers")
392-
393-
result = dpnp_norm(input, ord=ord, axis=axis)
385+
if not use_origin_backend(input):
386+
if not isinstance(input, dparray):
387+
pass
388+
elif not isinstance(axis, int) and not isinstance(axis, tuple) and axis is not None:
389+
pass
390+
elif keepdims is not False:
391+
pass
392+
elif ord not in [None, 0, 3, 'fro', 'f']:
393+
pass
394+
else:
395+
result = dpnp_norm(input, ord=ord, axis=axis)
394396

395-
# scalar returned
396-
if result.shape == (1,) and axis is None:
397-
return result.dtype.type(result[0])
397+
# scalar returned
398+
if result.shape == (1,) and axis is None:
399+
return result.dtype.type(result[0])
398400

399-
return result
401+
return result
400402

401403
return call_origin(numpy.linalg.norm, input, ord, axis, keepdims)
402404

0 commit comments

Comments
 (0)