There is a minor quirk in PyTorch which makes tree_map(lambda x: x, torch.Size([10, 10])) return (10, 10), not torch.Size([10, 10]).
This in turn makes qtensor.shape return a plain tuple, not a torch.Size object
Main Changes
Added special handling for attribute descriptors of QuantizedTensorBase.
Now qtensor.shape will return torch.Size object, not a plain tuple.
Problem Statement
There is a minor quirk in PyTorch which makes
tree_map(lambda x: x, torch.Size([10, 10]))
return(10, 10)
, nottorch.Size([10, 10])
. This in turn makesqtensor.shape
return a plain tuple, not atorch.Size
objectMain Changes
Added special handling for attribute descriptors of QuantizedTensorBase. Now
qtensor.shape
will returntorch.Size
object, not a plain tuple.