mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-09 05:40:49 +08:00
Make sure empty 3d tensors get reshaped correctly
This commit is contained in:
parent
cca52736d3
commit
101644cc42
@ -437,7 +437,7 @@ def fp8_linear(self, input):
|
||||
|
||||
uncast_bias_weight(self, w, bias, offload_stream)
|
||||
if tensor_3d:
|
||||
o = o.reshape((-1, input_shape[1], w.shape[0]))
|
||||
o = o.reshape((input_shape[0], input_shape[1], w.shape[0]))
|
||||
|
||||
return o
|
||||
|
||||
@ -676,7 +676,7 @@ def mixed_precision_ops(quant_config={}, compute_dtype=torch.bfloat16, full_prec
|
||||
|
||||
# Reshape output back to 3D if input was 3D
|
||||
if tensor_3d:
|
||||
output = output.reshape((-1, input_shape[1], self.weight.shape[0]))
|
||||
output = output.reshape((input_shape[0], input_shape[1], self.weight.shape[0]))
|
||||
|
||||
return output
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user