% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nn-utils-clip-grad.R
\name{nn_utils_clip_grad_norm_}
\alias{nn_utils_clip_grad_norm_}
\title{Clips gradient norm of an iterable of parameters.}
\usage{
nn_utils_clip_grad_norm_(parameters, max_norm, norm_type = 2)
}
\arguments{
\item{parameters}{(IterableTensor or Tensor): an iterable of Tensors or a
single Tensor that will have gradients normalized}

\item{max_norm}{(float or int): max norm of the gradients}

\item{norm_type}{(float or int): type of the used p-norm. Can be \code{Inf} for
infinity norm.}
}
\value{
Total norm of the parameters (viewed as a single vector).
}
\description{
The norm is computed over all gradients together, as if they were
concatenated into a single vector. Gradients are modified in-place.
}
