Skip to content

Commit 218cdc9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent cc85284 commit 218cdc9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

deepmd/utils/summary.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,19 @@ def __call__(self) -> None:
7979
try:
8080
if backend == "PyTorch":
8181
import torch
82+
8283
if torch.cuda.is_available():
8384
device_name = torch.cuda.get_device_name(0)
8485
elif backend == "TensorFlow":
8586
import tensorflow as tf
87+
8688
gpus = tf.config.list_physical_devices("GPU")
8789
if gpus:
8890
# Use the first physical GPU device identifier as the device name
8991
device_name = gpus[0].name
9092
elif backend == "Paddle":
9193
import paddle
94+
9295
# Use Paddle's current device string (e.g., "gpu:0") as a device identifier
9396
device_name = paddle.get_device()
9497
except Exception:

0 commit comments

Comments
 (0)