Skip to content

Commit 4dbf260

Browse files
Fix remarks
1 parent 3e6530b commit 4dbf260

File tree

6 files changed

+190
-191
lines changed

6 files changed

+190
-191
lines changed

dpnp/backend/include/dpnp_iface_fptr.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ enum class DPNPFuncName : size_t
312312
parameters */
313313
DPNP_FN_PLACE, /**< Used in numpy.place() impl */
314314
DPNP_FN_POWER, /**< Used in numpy.power() impl */
315-
DPNP_FN_POWER_EXT, /**< Used in numpy.power() impl, requires extra
316-
parameters */
317315
DPNP_FN_PROD, /**< Used in numpy.prod() impl */
318316
DPNP_FN_PROD_EXT, /**< Used in numpy.prod() impl, requires extra parameters
319317
*/

dpnp/backend/kernels/dpnp_krnl_elemwise.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -1628,13 +1628,6 @@ static void func_map_elemwise_2arg_3type_core(func_map_t &fmap)
16281628
func_type_map_t::find_type<FT1>,
16291629
func_type_map_t::find_type<FTs>>}),
16301630
...);
1631-
((fmap[DPNPFuncName::DPNP_FN_POWER_EXT][FT1][FTs] =
1632-
{populate_func_types<FT1, FTs>(),
1633-
(void *)dpnp_power_c_ext<
1634-
func_type_map_t::find_type<populate_func_types<FT1, FTs>()>,
1635-
func_type_map_t::find_type<FT1>,
1636-
func_type_map_t::find_type<FTs>>}),
1637-
...);
16381631
((fmap[DPNPFuncName::DPNP_FN_SUBTRACT_EXT][FT1][FTs] =
16391632
{populate_func_types<FT1, FTs>(),
16401633
(void *)dpnp_subtract_c_ext<

dpnp/dpnp_algo/dpnp_algo.pxd

-2
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@ cdef extern from "dpnp_iface_fptr.hpp" namespace "DPNPFuncName": # need this na
190190
DPNP_FN_PARTITION
191191
DPNP_FN_PARTITION_EXT
192192
DPNP_FN_PLACE
193-
DPNP_FN_POWER
194-
DPNP_FN_POWER_EXT
195193
DPNP_FN_PROD
196194
DPNP_FN_PROD_EXT
197195
DPNP_FN_PTP

dpnp/dpnp_iface_mathematical.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1427,8 +1427,10 @@ def power(
14271427
>>> a = dp.array([1, 2, 3, 4, 5])
14281428
>>> b = dp.array([2, 2, 2, 2, 2])
14291429
>>> result = dp.power(a, b)
1430-
>>> [x for x in result]
1431-
[1, 4, 9, 16, 25]
1430+
>>> result
1431+
array([ 1, 4, 9, 16, 25])
1432+
>>> dp.power(a, 3)
1433+
array([ 1, 8, 27, 64, 125])
14321434
14331435
"""
14341436

tests/test_mathematical.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -993,9 +993,17 @@ def test_integer_power_of_0_or_1(self, val, dtype):
993993
@pytest.mark.parametrize("dtype", [dpnp.int32, dpnp.int64])
994994
def test_integer_to_negative_power(self, dtype):
995995
a = dpnp.arange(2, 10, dtype=dtype)
996+
b = dpnp.full(8, -2, dtype=dtype)
996997
zeros = dpnp.zeros(8, dtype=dtype)
997-
998-
assert_equal(a ** (-3), zeros)
998+
ones = dpnp.ones(8, dtype=dtype)
999+
1000+
assert_array_equal(ones ** (-2), zeros)
1001+
assert_equal(
1002+
a ** (-3), zeros
1003+
) # positive integer to negative integer power
1004+
assert_equal(
1005+
b ** (-4), zeros
1006+
) # negative integer to negative integer power
9991007

10001008
def test_float_to_inf(self):
10011009
a = numpy.array(

0 commit comments

Comments
 (0)