Skip to content

Commit efe0962

Browse files
authored
move OutOfMemoryError from deepmd to deepmd_utils (#3153)
To prevent circular import Signed-off-by: Jinzhe Zeng <[email protected]>
1 parent 8c1b467 commit efe0962

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

deepmd/utils/errors.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2+
from deepmd_utils.utils.errors import (
3+
OutOfMemoryError,
4+
)
5+
6+
27
class GraphTooLargeError(Exception):
38
"""The graph is too large, exceeding protobuf's hard limit of 2GB."""
49

@@ -7,5 +12,8 @@ class GraphWithoutTensorError(Exception):
712
pass
813

914

10-
class OutOfMemoryError(Exception):
11-
"""This error is caused by out-of-memory (OOM)."""
15+
__all__ = [
16+
"OutOfMemoryError",
17+
"GraphTooLargeError",
18+
"GraphWithoutTensorError",
19+
]

deepmd_utils/utils/batch_size.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import numpy as np
1414

15-
from deepmd.utils.errors import (
15+
from deepmd_utils.utils.errors import (
1616
OutOfMemoryError,
1717
)
1818

deepmd_utils/utils/errors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: LGPL-3.0-or-later
2+
class OutOfMemoryError(Exception):
3+
"""This error is caused by out-of-memory (OOM)."""

0 commit comments

Comments
 (0)