Docs
Comparison Ops

Comparison Operations

Comparison operations take two arrays as input, perform element-wise comparison, and return a new array. Only the equal and not_equal operations work on complex valued arrays. For other comparison operations, the imaginary part of complex arrays is ignored. All operations support automatic broadcasting like binary operations.

equal

def equal(arg0: Array, arg1: Array) -> Array
Performs element-wise equality comparison of two arrays.
Args

arg0: The first input array. arg1: The second input array.

Returns

An array of zeros or ones, containing the element-wise equality comparison of the input arrays.

Note
  • Supports automatic broadcasting.
  • Works with real and complex valued arrays.
  • Does not support automatic differentiation.

not_equal

def not_equal(arg0: Array, arg1: Array) -> Array
Performs element-wise inequality comparison of two arrays.
Args

arg0: The first input array. arg1: The second input array.

Returns

An array of zeros or ones, containing the element-wise inequality comparison of the input arrays.

Note
  • Supports automatic broadcasting.
  • Works with real and complex valued arrays.
  • Does not support automatic differentiation.

greater_equal

def greater_equal(arg0: Array, arg1: Array) -> Array
Performs element-wise greater than or equal to comparison of two arrays.
Args

arg0: The first input array. arg1: The second input array.

Returns

An array of zeros or ones, containing the element-wise greater than or equal to comparison of the input arrays.

Note
  • Supports automatic broadcasting.
  • Works only with real valued arrays. For complex inputs, the imaginary part is ignored.
  • Does not support automatic differentiation.

greater

def greater(arg0: Array, arg1: Array) -> Array
Performs element-wise greater than comparison of two arrays.
Args

arg0: The first input array. arg1: The second input array.

Returns

An array of zeros or ones, containing the element-wise greater than comparison of the input arrays.

Note
  • Supports automatic broadcasting.
  • Works only with real valued arrays. For complex inputs, the imaginary part is ignored.
  • Does not support automatic differentiation.

less_equal

def less_equal(arg0: Array, arg1: Array) -> Array
Performs element-wise less than or equal to comparison of two arrays.
Args

arg0: The first input array. arg1: The second input array.

Returns

An array of zeros or ones, containing the element-wise less than or equal to comparison of the input arrays.

Note
  • Supports automatic broadcasting.
  • Works only with real valued arrays. For complex inputs, the imaginary part is ignored.
  • Does not support automatic differentiation.

less

def less(arg0: Array, arg1: Array) -> Array
Performs element-wise less than comparison of two arrays.
Args

arg0: The first input array. arg1: The second input array.

Returns

An array of zeros or ones, containing the element-wise less than comparison of the input arrays.

Note
  • Supports automatic broadcasting.
  • Works only with real valued arrays. For complex inputs, the imaginary part is ignored.
  • Does not support automatic differentiation.