Skip to content

Commit e527813

Browse files
committed
Style
1 parent 73177df commit e527813

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/diffusers/models/upsampling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ def forward(self, hidden_states: torch.Tensor, output_size: Optional[int] = None
167167
if self.interpolate:
168168
# upsample_nearest_nhwc also fails when the number of output elements is large
169169
# https://github.com/pytorch/pytorch/issues/141831
170-
scale_factor = 2 if output_size is None else max([f/s for f,s in zip(output_size, hidden_states.shape[-2:])])
170+
scale_factor = (
171+
2 if output_size is None else max([f / s for f, s in zip(output_size, hidden_states.shape[-2:])])
172+
)
171173
if hidden_states.numel() * scale_factor > pow(2, 31):
172174
hidden_states = hidden_states.contiguous()
173175

0 commit comments

Comments
 (0)