Skip to content

Commit

Permalink
fix CI black issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jing committed Dec 7, 2023
1 parent ee54f92 commit 4719567
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nerfstudio/engine/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nerfstudio/utils/eval_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4719567

Please sign in to comment.