deepmd.pt.model.network.layernorm

Attributes

device

Classes

LayerNorm

Functions

empty_t(shape, precision)

Module Contents

deepmd.pt.model.network.layernorm.device[source]
deepmd.pt.model.network.layernorm.empty_t(shape, precision)[source]
class deepmd.pt.model.network.layernorm.LayerNorm(num_in, 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[source]
uni_init[source]
num_in[source]
precision[source]
prec[source]
matrix[source]
bias[source]
random_generator[source]
trainable[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.