From 4719567fc6bd036c1e821bd184872a06b85f2ab5 Mon Sep 17 00:00:00 2001 From: Jing Date: Thu, 7 Dec 2023 21:29:53 +0800 Subject: [PATCH] fix CI black issues --- nerfstudio/engine/trainer.py | 4 ++-- nerfstudio/utils/eval_utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nerfstudio/engine/trainer.py b/nerfstudio/engine/trainer.py index 87104254c5..c0897c1584 100644 --- a/nerfstudio/engine/trainer.py +++ b/nerfstudio/engine/trainer.py @@ -118,7 +118,7 @@ def __init__(self, config: TrainerConfig, local_rank: int = 0, world_size: int = if self.device == "cuda": self.device += f":{local_rank}" elif self.device == "xpu": - importlib.import_module('intel_extension_for_pytorch') + importlib.import_module("intel_extension_for_pytorch") self.mixed_precision: bool = self.config.mixed_precision self.use_grad_scaler: bool = self.mixed_precision or self.config.use_grad_scaler self.training_state: Literal["training", "paused", "completed"] = "training" @@ -284,7 +284,7 @@ def train(self) -> None: # (https://pytorch.org/docs/stable/notes/cuda.html#cuda-memory-management) # for more details about GPU memory management. writer.put_scalar( - name="GPU Memory (MB)", scalar=torch.cuda.max_memory_allocated() / (1024**2), step=step + name="GPU Memory (MB)", scalar=torch.cuda.max_memory_allocated() / (1024 ** 2), step=step ) # Do not perform evaluation if there are no validation images diff --git a/nerfstudio/utils/eval_utils.py b/nerfstudio/utils/eval_utils.py index 4220446c26..225add5474 100644 --- a/nerfstudio/utils/eval_utils.py +++ b/nerfstudio/utils/eval_utils.py @@ -106,7 +106,7 @@ def eval_setup( device_type = "cuda" else: try: - importlib.import_module('intel_extension_for_pytorch') + importlib.import_module("intel_extension_for_pytorch") device_type = "xpu" if torch.xpu.is_available() else "cpu" except Exception: device_type = "cpu"