Skip to content
fn

logical_and_op

→TensorImplPtr
int logical_and_op(const int & a, const int & b)

Python wrappers

Public Python APIs implemented by this engine symbol.

Elementwise logical AND: yi=[ai≠0]∧[bi≠0]y_i = [a_i \ne 0] \land [b_i \ne 0].

Composite over not_equal_op (to coerce each operand to a bool mask) + bitwise_and_op. Not differentiable — the output is integral and bitwise_* has no backward.

Math

yi=1 ⁣[ai≠0]⋅1 ⁣[bi≠0] y_i = \mathbb{1}\!\left[ a_i \ne 0 \right] \cdot \mathbb{1}\!\left[ b_i \ne 0 \right]

See Also

bitwise_and_op — bit-level variant on integer inputs.

Parameters

a, bTensorImplPtr
Operands of broadcastable shapes and arbitrary numeric dtype.

Returns

TensorImplPtr

Bool tensor on the broadcast shape of a and b.