MCPcopy Create free account
hub / github.com/numpy/numpy / pow

Function pow

numpy/array_api/_elementwise_functions.py:613–624  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.power `. See its docstring for more information.

(x1: Array, x2: Array, /)

Source from the content-addressed store, hash-verified

611
612# Note: the function name is different here
613def pow(x1: Array, x2: Array, /) -> Array:
614 """
615 Array API compatible wrapper for :py:func:`np.power <numpy.power>`.
616
617 See its docstring for more information.
618 """
619 if x1.dtype not in _numeric_dtypes or x2.dtype not in _numeric_dtypes:
620 raise TypeError("Only numeric dtypes are allowed in pow")
621 # Call result type here just to raise on disallowed type combinations
622 _result_type(x1.dtype, x2.dtype)
623 x1, x2 = Array._normalize_two_args(x1, x2)
624 return Array._new(np.power(x1._array, x2._array))
625
626
627def real(x: Array, /) -> Array:

Callers 12

legacy_standard_gammaFunction · 0.85
legacy_weibullFunction · 0.85
legacy_powerFunction · 0.85
legacy_betaFunction · 0.85
random_standard_gammaFunction · 0.85
random_betaFunction · 0.85
random_weibullFunction · 0.85
random_powerFunction · 0.85
random_zipfFunction · 0.85
test_modular_powerMethod · 0.85
__pow__Method · 0.85
__rpow__Method · 0.85

Calls 3

_result_typeFunction · 0.85
_normalize_two_argsMethod · 0.80
_newMethod · 0.80

Tested by 1

test_modular_powerMethod · 0.68