% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/autograd.R
\name{ag_sum}
\alias{ag_sum}
\title{Sum all elements (or along a dim): out = sum(x)}
\usage{
ag_sum(x, dim = NULL, keepdim = FALSE)
}
\arguments{
\item{x}{ag_tensor}

\item{dim}{NULL (all), 1 (row-wise), or 2 (col-wise)}

\item{keepdim}{Logical: keep size-1 dimensions}
}
\value{
scalar (or reduced) ag_tensor
}
\description{
Sum all elements (or along a dim): out = sum(x)
}
