Skip to content

Commit 101644c

Browse files
committed
Make sure empty 3d tensors get reshaped correctly
1 parent cca5273 commit 101644c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

comfy/ops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def fp8_linear(self, input):
437437

438438
uncast_bias_weight(self, w, bias, offload_stream)
439439
if tensor_3d:
440-
o = o.reshape((-1, input_shape[1], w.shape[0]))
440+
o = o.reshape((input_shape[0], input_shape[1], w.shape[0]))
441441

442442
return o
443443

@@ -676,7 +676,7 @@ def forward(self, input, *args, **kwargs):
676676

677677
# Reshape output back to 3D if input was 3D
678678
if tensor_3d:
679-
output = output.reshape((-1, input_shape[1], self.weight.shape[0]))
679+
output = output.reshape((input_shape[0], input_shape[1], self.weight.shape[0]))
680680

681681
return output
682682

0 commit comments

Comments
 (0)