Skip to main content

ClikaRT::ops::any

function

any()​

Tensor any(
    Tensor input,
    ClikaRT::Span<const std::int64_t> dims = {},
    bool keepdim = false
)

True where ANY element over dims is nonzero (logical OR reduce).

Empty dims reduces every dimension. Output dtype is always Bool. An element is nonzero exactly when its Bool cast is true: +0 and -0 are zero; a subnormal, an infinity and a NaN are nonzero.

Parameters

  • input: the input tensor; any dtype (nonzero = true).
  • dims: axes to reduce; empty = all axes.
  • keepdim: keep reduced axes as size-1 dims; default false.

Returns: a Bool tensor; shape = input minus dims.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) on an out-of-range dims entry.

Declared in ClikaRT/compute/ops.h, line 4326