Skip to main content

ClikaRT::ops::nanmean

function

nanmean()

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

Mean over dims, treating NaN entries as missing.

Each output element divides by the count of NON-NaN contributors (an all-NaN slice yields NaN). Float dtypes only.

Parameters

  • x: the input tensor; float dtype.
  • dims: axes to reduce; empty = all axes.
  • keepdim: keep reduced axes as size-1 dims; default false.

Returns: the NaN-skipping mean; shape = x minus dims.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) on an out-of-range dims entry or a non-float input.

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