From 811a411a47e8c4d1b74f146cc09a2d59547c4a82 Mon Sep 17 00:00:00 2001 From: Tai-Wang Date: Mon, 25 Dec 2023 18:55:23 +0800 Subject: [PATCH] Fix linting --- embodiedscan/structures/array_converter.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/embodiedscan/structures/array_converter.py b/embodiedscan/structures/array_converter.py index fcd02f4..e976097 100644 --- a/embodiedscan/structures/array_converter.py +++ b/embodiedscan/structures/array_converter.py @@ -137,8 +137,8 @@ def new_func(*args, **kwargs): for i, arg_value in enumerate(named_args): if arg_names[i] in apply_to: new_args.append( - converter.convert( - input_array=arg_value, target_type=target_type)) + converter.convert(input_array=arg_value, + target_type=target_type)) else: new_args.append(arg_value) @@ -309,8 +309,8 @@ def convert( converted_array = input_array.cpu().numpy().astype(np.float32) else: # default dtype is float32, device is 'cpu' - converted_array = torch.tensor( - input_array, dtype=torch.float32) + converted_array = torch.tensor(input_array, + dtype=torch.float32) else: assert isinstance(target_array, (np.ndarray, torch.Tensor)), \ 'invalid target array type' @@ -341,8 +341,9 @@ def recover( elif isinstance(input_array, torch.Tensor): converted_array = input_array.cpu().numpy().astype(self.dtype) else: - converted_array = torch.tensor( - input_array, dtype=self.dtype, device=self.device) + converted_array = torch.tensor(input_array, + dtype=self.dtype, + device=self.device) if self.is_num: converted_array = converted_array.item() return converted_array