TensorPlay
Reference guides
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.nn.init

tensorplay.nn.init.calculate_gain

Return the recommended gain value for the given nonlinearity.

tensorplay.nn.init.uniform_

Fill tensor in-place with samples from U(a, b).

tensorplay.nn.init.normal_

Fill tensor in-place with samples from N(mean, std^2).

tensorplay.nn.init.constant_

Fill tensor in-place with the scalar val.

tensorplay.nn.init.ones_

Fill tensor in-place with the scalar value 1.

tensorplay.nn.init.zeros_

Fill tensor in-place with the scalar value 0.

tensorplay.nn.init.eye_

Fill the 2-D tensor in-place with the identity matrix.

tensorplay.nn.init.dirac_

Fill the {3, 4, 5}-D tensor in-place with Dirac delta kernels.

tensorplay.nn.init.xavier_uniform_

Fill tensor in-place with U(-a, a) where a = gain * sqrt(6 / (fan_in + fan_out)).

tensorplay.nn.init.xavier_normal_

Fill tensor in-place with N(0, std^2) where std = gain * sqrt(2 / (fan_in + fan_out)).

tensorplay.nn.init.kaiming_uniform_

Fill tensor in-place with U(-bound, bound) where bound = gain * sqrt(3 / fan).

tensorplay.nn.init.kaiming_normal_

Fill tensor in-place with N(0, std^2) where std = gain / sqrt(fan).

tensorplay.nn.init.trunc_normal_

Fills the input Tensor with values drawn from a truncated normal distribution.

tensorplay.nn.init.orthogonal_

Fill tensor in-place with a (semi) orthogonal matrix.

tensorplay.nn.init.sparse_

Fill the 2-D tensor in-place as a sparse matrix.

Ask DeepWiki