Skip to content

Commit

Permalink
use math.prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Han Wang committed Feb 13, 2024
1 parent f401eb6 commit 6573e19
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions deepmd/pt/model/model/make_hessian_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import copy
import math
from typing import (
Dict,
List,
Expand Down Expand Up @@ -139,9 +140,7 @@ def _cal_hessian_all(
for kk in hess_keys:
vdef = fdef[kk]
vshape = vdef.shape
vsize = 1
for ii in vshape:
vsize *= ii
vsize = math.prod(vdef.shape)
# loop over frames
for ii in range(nf):
icoord = coord[ii]
Expand Down

0 comments on commit 6573e19

Please sign in to comment.