MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / reshape_tensor

Method reshape_tensor

lightx2v/utils/quant_utils.py:77–82  ·  view source on GitHub ↗
(self, tensor, allow_padding=False)

Source from the content-addressed store, hash-verified

75 return scales, zeros, qmax, qmin
76
77 def reshape_tensor(self, tensor, allow_padding=False):
78 if self.granularity == "per_group":
79 t = tensor.reshape(-1, self.group_size)
80 else:
81 t = tensor
82 return t
83
84 def restore_tensor(self, tensor, shape):
85 if tensor.shape == shape:

Callers 1

get_tensor_qparamsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected