% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/random.R
\name{mx.set.seed}
\alias{mx.set.seed}
\title{Set the seed used by mxnet device-specific random number generators.}
\usage{
mx.set.seed(seed)
}
\arguments{
\item{seed}{the seed value to the device random number generators.}
}
\description{
Set the seed used by mxnet device-specific random number generators.
}
\details{
We have a specific reason why \code{mx.set.seed} is introduced,
instead of simply use \code{set.seed}.

The reason that is that most of mxnet random number generator
can run on different devices, such as GPU.
We need to use massively parallel PRNG on GPU to get fast
random number generations. It can also be quite costly to seed these PRNGs.
So we introduced \code{mx.set.seed} for mxnet specific device random numbers.
}
\examples{

mx.set.seed(0)
as.array(mx.runif(2))
# 0.5488135 0.5928446
mx.set.seed(0)
as.array(mx.rnorm(2))
# 2.212206 1.163079

}

