Sums tensor values along an axis.
More...
#include <reductions.hpp>
Sums tensor values along an axis.
Preserves input dtype. Use keepdim=true
to maintain shape for broadcasting.
Example (NumPy/PyTorch behavior):
{3, 4}};
Tensor Y = sum(X, 0);
Tensor Z = sum(X, 1,
A multidimensional, strided tensor data structure.
Definition: tensor.hpp:105
◆ forward()
void tannic::expression::Argsum::forward |
( |
Tensor const & |
input, |
|
|
Tensor & |
output |
|
) |
| const |
◆ reduce() [1/2]
constexpr Shape tannic::expression::Argsum::reduce |
( |
Shape const & |
shape | ) |
const |
|
inlineconstexpr |
◆ reduce() [2/2]
constexpr type tannic::expression::Argsum::reduce |
( |
type |
dtype | ) |
const |
|
inlineconstexpr |
◆ axis
int tannic::expression::Argsum::axis |
◆ keepdim
bool tannic::expression::Argsum::keepdim |
The documentation for this struct was generated from the following file: