Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torchani
Commits
e3096aa1
Unverified
Commit
e3096aa1
authored
Mar 23, 2019
by
Gao, Xiang
Committed by
GitHub
Mar 23, 2019
Browse files
fix deprecated in inference benchmark (#192)
parent
d6932a16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tools/inference-benchmark.py
tools/inference-benchmark.py
+2
-2
No files found.
tools/inference-benchmark.py
View file @
e3096aa1
...
...
@@ -76,7 +76,7 @@ print()
# test batch mode
print
(
'[Batch mode]'
)
species
,
coordinates
=
torch
.
utils
.
data
.
dataloader
.
default_collate
(
list
(
xyz
))
coordinates
=
torch
.
tensor
(
coordinates
,
requires_grad
=
True
)
coordinates
.
requires_grad
_
(
True
)
start
=
timeit
.
default_timer
()
energies
=
nnp
((
species
,
coordinates
))[
1
]
mid
=
timeit
.
default_timer
()
...
...
@@ -92,7 +92,7 @@ if parser.tqdm:
xyz
=
tqdm
.
tqdm
(
xyz
)
for
species
,
coordinates
in
xyz
:
species
=
species
.
unsqueeze
(
0
)
coordinates
=
torch
.
tensor
(
coordinates
.
unsqueeze
(
0
)
,
requires_grad
=
True
)
coordinates
=
coordinates
.
unsqueeze
(
0
)
.
detach
().
requires_grad
_
(
True
)
energies
=
nnp
((
species
,
coordinates
))[
1
]
force
=
-
torch
.
autograd
.
grad
(
energies
.
sum
(),
coordinates
)[
0
]
print
(
'Time:'
,
timeit
.
default_timer
()
-
start
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment