Skip to content
fn

normal_op

→TensorImplPtr
int normal_op(const int & shape, double mean, double std, Dtype dt, Device device, Generator * gen)

Python wrappers

Public Python APIs implemented by this engine symbols.

Allocates a tensor filled with Gaussian samples N(mean,std2)\mathcal{N}(\mathrm{mean}, \mathrm{std}^2).

Math

xi∼N(mean,std2)x_i \sim \mathcal{N}(\mathrm{mean}, \mathrm{std}^2)

See Also

randn_op — shortcut for N(0,1)\mathcal{N}(0, 1).

Parameters

shapeconst Shape&
Shape of the output tensor.
meandouble
Location parameter μ\mu.
stddouble
Scale parameter σ\sigma. Must be non-negative; a value of 0 produces a constant tensor equal to mean.
dtDtype
Element dtype. Floating-point only.
deviceDevice
Memory domain.
genGenerator*= None
Bit-stream state.

Returns

TensorImplPtr

Newly allocated leaf tensor (requires_grad = false).

Raises

LucidError
If std < 0.