Skip to content
fn

all_op

→TensorImplPtr
int all_op(const int & a)

Python wrappers

Public Python APIs implemented by this engine symbol.

Full-tensor boolean AND-reduction — returns a scalar Bool tensor that is True iff every element of a is non-zero.

Not differentiable: predicate output is detached.

Math

y=⋀i(xi≠0)y = \bigwedge_i (x_i \ne 0)

Shape

Output is a 0-D scalar; input may have any shape.

See Also

any_op.

Parameters

aTensorImplPtr
Input tensor of any dtype. Floating-point 0.0 counts as False; NaN counts as True.

Returns

TensorImplPtr

Zero-dimensional Dtype::Bool tensor. Shape is {}.

Notes

Reduction is over the flattened tensor. An empty tensor returns True (vacuous truth) — call sites should special-case zero numel if a different convention is needed.