-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the test models and CI dependencies (#73)
* Update dependencies * Downgrade GCC * Reverse enginier a model generator * Regenerate the model with PyTorch 1.11 * Update to PyTorch 1.11 * Update to Python 3.10 * Empty line * Simplify the test models
- Loading branch information
Raimondas Galvelis
authored
May 26, 2022
1 parent
84f7d88
commit fa102e6
Showing
6 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import torch as pt | ||
|
||
class Central(pt.nn.Module): | ||
def forward(self, pos): | ||
return pos.pow(2).sum() | ||
|
||
class Forces(pt.nn.Module): | ||
def forward(self, pos): | ||
return pos.pow(2).sum(), -2 * pos | ||
|
||
class Global(pt.nn.Module): | ||
def forward(self, pos, k): | ||
return k * pos.pow(2).sum() | ||
|
||
class Periodic(pt.nn.Module): | ||
def forward(self, pos, box): | ||
box = box.diagonal().unsqueeze(0) | ||
pos = pos - (pos / box).floor() * box | ||
return pos.pow(2).sum() | ||
|
||
pt.jit.script(Central()).save('central.pt') | ||
pt.jit.script(Forces()).save('forces.pt') | ||
pt.jit.script(Global()).save('global.pt') | ||
pt.jit.script(Periodic()).save('periodic.pt') |
Binary file not shown.
Binary file not shown.