Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tai-Wang committed Dec 25, 2023
1 parent 325dff0 commit 811a411
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions embodiedscan/structures/array_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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

0 comments on commit 811a411

Please sign in to comment.