Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
7e00f556
Unverified
Commit
7e00f556
authored
Mar 28, 2022
by
Peter Eastman
Committed by
GitHub
Mar 28, 2022
Browse files
Workaround for PyTorch bug (#3533)
parent
c7af17c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
platforms/common/src/CommonKernels.cpp
platforms/common/src/CommonKernels.cpp
+4
-3
No files found.
platforms/common/src/CommonKernels.cpp
View file @
7e00f556
...
...
@@ -5378,7 +5378,6 @@ void CommonCalcCustomCVForceKernel::initialize(const System& system, const Custo
}
double
CommonCalcCustomCVForceKernel
::
execute
(
ContextImpl
&
context
,
ContextImpl
&
innerContext
,
bool
includeForces
,
bool
includeEnergy
)
{
ContextSelector
selector
(
cc
);
copyState
(
context
,
innerContext
);
int
numCVs
=
variableNames
.
size
();
int
numAtoms
=
cc
.
getNumAtoms
();
...
...
@@ -5387,13 +5386,15 @@ double CommonCalcCustomCVForceKernel::execute(ContextImpl& context, ContextImpl&
vector
<
map
<
string
,
double
>
>
cvDerivs
(
numCVs
);
for
(
int
i
=
0
;
i
<
numCVs
;
i
++
)
{
cvValues
.
push_back
(
innerContext
.
calcForcesAndEnergy
(
true
,
true
,
1
<<
i
));
ContextSelector
selector
(
cc
);
copyForcesKernel
->
setArg
(
0
,
cvForces
[
i
]);
copyForcesKernel
->
execute
(
numAtoms
);
innerContext
.
getEnergyParameterDerivatives
(
cvDerivs
[
i
]);
}
// Compute the energy and forces.
ContextSelector
selector
(
cc
);
map
<
string
,
double
>
variables
;
for
(
auto
&
name
:
globalParameterNames
)
variables
[
name
]
=
context
.
getParameter
(
name
);
...
...
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