Skip to content

Commit

Permalink
move OutOfMemoryError from deepmd to deepmd_utils
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Jan 18, 2024
1 parent d915a91 commit 10ec25a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
12 changes: 10 additions & 2 deletions deepmd/utils/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from deepmd_utils.utils.errors import (
OutOfMemoryError,
)


class GraphTooLargeError(Exception):
"""The graph is too large, exceeding protobuf's hard limit of 2GB."""

Expand All @@ -7,5 +12,8 @@ class GraphWithoutTensorError(Exception):
pass


class OutOfMemoryError(Exception):
"""This error is caused by out-of-memory (OOM)."""
__all__ = [
"OutOfMemoryError",
"GraphTooLargeError",
"GraphWithoutTensorError",
]
2 changes: 1 addition & 1 deletion deepmd_utils/utils/batch_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import numpy as np

from deepmd.utils.errors import (
from deepmd_utils.utils.errors import (
OutOfMemoryError,
)

Expand Down
3 changes: 3 additions & 0 deletions deepmd_utils/utils/errors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
class OutOfMemoryError(Exception):
"""This error is caused by out-of-memory (OOM)."""

0 comments on commit 10ec25a

Please sign in to comment.