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

Function equal

numpy/array_api/_elementwise_functions.py:291–300  ·  view source on GitHub ↗

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

(x1: Array, x2: Array, /)

Source from the content-addressed store, hash-verified

289
290
291def equal(x1: Array, x2: Array, /) -> Array:
292 """
293 Array API compatible wrapper for :py:func:`np.equal <numpy.equal>`.
294
295 See its docstring for more information.
296 """
297 # Call result type here just to raise on disallowed type combinations
298 _result_type(x1.dtype, x2.dtype)
299 x1, x2 = Array._normalize_two_args(x1, x2)
300 return Array._new(np.equal(x1._array, x2._array))
301
302
303def exp(x: Array, /) -> Array:

Callers 1

test_device_propertyFunction · 0.50

Calls 3

_result_typeFunction · 0.85
_normalize_two_argsMethod · 0.80
_newMethod · 0.80

Tested by 1

test_device_propertyFunction · 0.40