Skip to content

Commit

Permalink
rm layernorm
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed Sep 27, 2024
1 parent 8588184 commit 7a917a7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions deepmd/pt/model/network/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
from deepmd.dpmodel.utils.type_embed import (
get_econf_tebd,
)
from deepmd.pt.model.network.layernorm import (
LayerNorm,
)
from deepmd.pt.utils.utils import (
ActivationFn,
to_torch_tensor,
Expand Down Expand Up @@ -694,15 +691,11 @@ def __init__(
self.type_map = type_map
self.econf_tebd = None
embed_input_dim = ntypes
self.econf_norm = None
if self.use_econf_tebd:
econf_tebd, embed_input_dim = get_econf_tebd(
self.type_map, precision=self.precision
)
self.econf_tebd = to_torch_tensor(econf_tebd)
self.econf_norm = LayerNorm(
self.neuron[-1], trainable=False, precision=precision, seed=seed
)
self.embedding_net = EmbeddingNet(
embed_input_dim,
self.neuron,
Expand All @@ -729,9 +722,7 @@ def forward(self, device: torch.device):
)
else:
assert self.econf_tebd is not None
assert self.econf_norm is not None
embed = self.embedding_net(self.econf_tebd.to(device))
embed = self.econf_norm(embed)
if self.padding:
embed = torch.cat(
[embed, torch.zeros(1, embed.shape[1], dtype=self.prec, device=device)]
Expand Down

0 comments on commit 7a917a7

Please sign in to comment.