From 951989117ba5b3cf01772eda6312ee35c778f3ee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 2 May 2023 20:22:08 +0800 Subject: [PATCH] Format code (#214) Co-authored-by: github-actions[bot] --- config.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config.py b/config.py index d4de084..5fc5d62 100644 --- a/config.py +++ b/config.py @@ -53,7 +53,7 @@ class Config: i_device = int(self.device.split(":")[-1]) self.gpu_name = torch.cuda.get_device_name(i_device) if ( - ("16" in gpu_name and "V100"not in gpu_name.upper()) + ("16" in gpu_name and "V100" not in gpu_name.upper()) or "P40" in self.gpu_name.upper() or "1070" in self.gpu_name or "1080" in self.gpu_name @@ -72,12 +72,12 @@ class Config: else: self.gpu_name = None self.gpu_mem = int( - torch.cuda.get_device_properties(i_device).total_memory - / 1024 - / 1024 - / 1024 - + 0.4 - ) + torch.cuda.get_device_properties(i_device).total_memory + / 1024 + / 1024 + / 1024 + + 0.4 + ) if self.gpu_mem <= 4: with open("trainset_preprocess_pipeline_print.py", "r") as f: strr = f.read().replace("3.7", "3.0") @@ -90,7 +90,7 @@ class Config: print("没有发现支持的N卡, 使用CPU进行推理") self.device = "cpu" self.is_half = True - + if self.n_cpu == 0: self.n_cpu = cpu_count()