Skip to content

Commit

Permalink
Update output_def.py
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed Mar 2, 2024
1 parent f3c7bf2 commit 967736a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deepmd/dpmodel/output_def.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import functools
import math
from enum import (
IntEnum,
)
Expand Down Expand Up @@ -194,7 +193,11 @@ def __init__(
):
self.name = name
self.shape = list(shape)
self.output_size = math.prod(self.shape)
# jit doesn't support math.prod(self.shape)
self.output_size = 1
len_shape = len(self.shape)
for i in range(len_shape):
self.output_size *= self.shape[i]

Check warning on line 200 in deepmd/dpmodel/output_def.py

View check run for this annotation

Codecov / codecov/patch

deepmd/dpmodel/output_def.py#L197-L200

Added lines #L197 - L200 were not covered by tests
self.atomic = atomic
self.reduciable = reduciable
self.r_differentiable = r_differentiable
Expand Down

0 comments on commit 967736a

Please sign in to comment.