Skip to content

Commit ae0500b

Browse files
committed
Format custom_conv2d with ruff
1 parent 0c5be33 commit ae0500b

File tree

1 file changed

+11
-14
lines changed
  • invokeai/backend/model_manager/load/model_cache/torch_module_autocast/custom_modules

1 file changed

+11
-14
lines changed

invokeai/backend/model_manager/load/model_cache/torch_module_autocast/custom_modules/custom_conv2d.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,17 @@ def forward(self, input: torch.Tensor) -> torch.Tensor:
5454
return self._autocast_forward_with_patches(input)
5555
elif self._device_autocasting_enabled:
5656
return self._autocast_forward(input)
57-
elif (
58-
input.is_floating_point()
59-
and (
60-
(
61-
self.weight.is_floating_point()
62-
and not isinstance(self.weight, GGMLTensor)
63-
and self.weight.dtype != input.dtype
64-
)
65-
or (
66-
self.bias is not None
67-
and self.bias.is_floating_point()
68-
and not isinstance(self.bias, GGMLTensor)
69-
and self.bias.dtype != input.dtype
70-
)
57+
elif input.is_floating_point() and (
58+
(
59+
self.weight.is_floating_point()
60+
and not isinstance(self.weight, GGMLTensor)
61+
and self.weight.dtype != input.dtype
62+
)
63+
or (
64+
self.bias is not None
65+
and self.bias.is_floating_point()
66+
and not isinstance(self.bias, GGMLTensor)
67+
and self.bias.dtype != input.dtype
7168
)
7269
):
7370
weight = self._cast_tensor_for_input(self.weight, input)

0 commit comments

Comments
 (0)