% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gen-namespace-docs.R,
%   R/gen-namespace-examples.R, R/gen-namespace.R
\name{torch_trace}
\alias{torch_trace}
\title{Trace}
\usage{
torch_trace(self)
}
\arguments{
\item{self}{the input tensor}
}
\description{
Trace
}
\section{trace(input) -> Tensor }{


Returns the sum of the elements of the diagonal of the input 2-D matrix.
}

\examples{
if (torch_is_installed()) {

x <- torch_arange(1, 9)$view(c(3, 3))
x
torch_trace(x)
}
}
