Tannic
A C++ Tensor Library
Loading...
Searching...
No Matches
tannic::expression::Argmean Struct Reference

Computes the mean along an axis. More...

#include <reductions.hpp>

Public Member Functions

constexpr type reduce (type dtype) const
 
constexpr Shape reduce (Shape const &shape) const
 
void forward (Tensor const &input, Tensor &output) const
 

Public Attributes

int axis
 
bool keepdim = false
 

Detailed Description

Computes the mean along an axis.

Requires floating-point input (float32/float64).
Use keepdim=true to maintain shape for broadcasting.

Example:

Tensor X = {{1.0, 2.0},
{3.0, 4.0}};
Tensor Y = mean(X, 0);
// Y = [2.0, 3.0] // (1+3)/2=2.0, (2+4)/2=3.0
A multidimensional, strided tensor data structure.
Definition: tensor.hpp:105

Member Function Documentation

◆ forward()

void tannic::expression::Argmean::forward ( Tensor const &  input,
Tensor output 
) const

◆ reduce() [1/2]

constexpr Shape tannic::expression::Argmean::reduce ( Shape const &  shape) const
inlineconstexpr

◆ reduce() [2/2]

constexpr type tannic::expression::Argmean::reduce ( type  dtype) const
inlineconstexpr

Member Data Documentation

◆ axis

int tannic::expression::Argmean::axis

◆ keepdim

bool tannic::expression::Argmean::keepdim = false

The documentation for this struct was generated from the following file: