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

pt: make jit happy with torch 2.0.0 #3443

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions deepmd/pt/model/task/dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,6 @@
# (nframes, nloc, 3)
out = torch.bmm(out, gr).squeeze(-2).view(nframes, nloc, 3)
return {self.var_name: out.to(env.GLOBAL_PT_FLOAT_PRECISION)}

# make jit happy with torch 2.0.0
exclude_types: List[int]

Check warning on line 197 in deepmd/pt/model/task/dipole.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/task/dipole.py#L197

Added line #L197 was not covered by tests
6 changes: 6 additions & 0 deletions deepmd/pt/model/task/ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@
"""
return self._forward_common(descriptor, atype, gr, g2, h2, fparam, aparam)

# make jit happy with torch 2.0.0
exclude_types: List[int]

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L218 was not covered by tests


@Fitting.register("ener")
class EnergyFittingNet(InvarFitting):
Expand Down Expand Up @@ -262,6 +265,9 @@
"type": "ener",
}

# make jit happy with torch 2.0.0
exclude_types: List[int]

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L269 was not covered by tests


@Fitting.register("direct_force")
@Fitting.register("direct_force_ener")
Expand Down
3 changes: 3 additions & 0 deletions deepmd/pt/model/task/polarizability.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,6 @@
out = out + bias

return {self.var_name: out.to(env.GLOBAL_PT_FLOAT_PRECISION)}

# make jit happy with torch 2.0.0
exclude_types: List[int]

Check warning on line 321 in deepmd/pt/model/task/polarizability.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/task/polarizability.py#L321

Added line #L321 was not covered by tests