mlx icon indicating copy to clipboard operation
mlx copied to clipboard

[BUG] Missing logical operators

Open dionhaefner opened this issue 1 year ago • 1 comments

>>> mx.array([1], dtype=mx.bool_) & mx.array([0], dtype=mx.bool_)
TypeError: unsupported operand type(s) for &: 'mlx.core.array' and 'mlx.core.array'

>>> mx.logical_and(mx.array([1], dtype=mx.bool_), mx.array([0], dtype=mx.bool_))
AttributeError: module 'mlx.core' has no attribute 'logical_and'. Did you mean: 'logical_not'?

dionhaefner avatar Jan 04 '24 08:01 dionhaefner

Yup we should add that and logical_or and the overloads. It shouldn't be too difficult to get those in.

awni avatar Jan 04 '24 14:01 awni