deepmd.pt.model.network.layernorm#

Attributes#

Classes#

Functions#

empty_t(→ torch.Tensor)

Module Contents#

deepmd.pt.model.network.layernorm.device[source]#
deepmd.pt.model.network.layernorm.empty_t(shape: tuple[int, Ellipsis], precision: torch.dtype) torch.Tensor[source]#
class deepmd.pt.model.network.layernorm.LayerNorm(num_in: int, eps: float = 1e-05, uni_init: bool = True, bavg: float = 0.0, stddev: float = 1.0, precision: str = DEFAULT_PRECISION, trainable: bool = True, seed: int | list[int] | None = None)[source]#

Bases: torch.nn.Module

eps = 1e-05[source]#
uni_init = True[source]#
num_in[source]#
precision = 'float64'[source]#
prec[source]#
matrix[source]#
bias[source]#
trainable = True[source]#
dim_out() int[source]#
forward(xx: torch.Tensor) torch.Tensor[source]#

One Layer Norm used by DP model.

Parameters:
xxtorch.Tensor

The input of index.

Returns:
yy: torch.Tensor

The output.

serialize() dict[source]#

Serialize the layer to a dict.

Returns:
dict

The serialized layer.

classmethod deserialize(data: dict) LayerNorm[source]#

Deserialize the layer from a dict.

Parameters:
datadict

The dict to deserialize from.