Skip to content
fn

randn_op

→TensorImplPtr
int randn_op(const int & shape, Dtype dt, Device device, Generator * gen)

Python wrappers

Public Python APIs implemented by this engine symbol.

Allocates a tensor filled with standard-normal samples N(0,1)\mathcal{N}(0, 1).

Convenience wrapper around normal_op with mean = 0 / std = 1.

Math

xi∼N(0,1)x_i \sim \mathcal{N}(0, 1)

See Also

normal_op — arbitrary mean / std. rand_op — uniform variant.

Parameters

shapeconst Shape&
Shape of the output tensor.
dtDtype
Element dtype. Floating-point only.
deviceDevice
Memory domain.
genGenerator*= None
Bit-stream state; falls back to default_generator.

Returns

TensorImplPtr

Newly allocated leaf tensor (requires_grad = false).