% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/autograd.R
\name{ag_clamp}
\alias{ag_clamp}
\title{Element-wise clamp}
\usage{
ag_clamp(x, lo = -Inf, hi = Inf)
}
\arguments{
\item{x}{ag_tensor}

\item{lo}{Lower bound (default \code{-Inf})}

\item{hi}{Upper bound (default \code{Inf})}
}
\value{
ag_tensor
}
\description{
Clamps values to \code{[lo, hi]}.  Gradient is 1 inside the interval,
0 at the boundary (straight-through estimator).
}
