Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug of output dimension in pt InvarFitting #3274

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions deepmd/pt/model/task/ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
self.aparam_avg, self.aparam_inv_std = None, None

in_dim = self.dim_descrpt + self.numb_fparam + self.numb_aparam
out_dim = 1

self.old_impl = kwargs.get("old_impl", False)
if self.old_impl:
Expand All @@ -144,7 +143,7 @@
networks=[
FittingNet(
in_dim,
out_dim,
self.dim_out,
self.neuron,
self.activation_function,
self.resnet_dt,
Expand Down Expand Up @@ -358,7 +357,7 @@
dim=-1,
)

outs = torch.zeros_like(atype).unsqueeze(-1) # jit assertion
outs = torch.zeros(nf, nloc, self.dim_out) # jit assertion

Check warning on line 360 in deepmd/pt/model/task/ener.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/task/ener.py#L360

Added line #L360 was not covered by tests
if self.old_impl:
outs = torch.zeros_like(atype).unsqueeze(-1) # jit assertion
assert self.filter_layers_old is not None
Expand Down