Open jerrysky3 opened 1 month ago
For the completeness of the conversion, maybe we need to store the actual original 1D shape in TTNN tensor object so to_torch
can convert it back to the orignal shape?
For the completeness of the conversion, maybe we need to store the actual original 1D shape in TTNN tensor object so
to_torch
can convert it back to the orignal shape?
Yes! @TT-BrianLiu and @ayerofieiev-tt are making the new amazing shape/layout in Tensor
When converting an 1D tensor into
TILE_LAYOUT
, the result tensor will have the shape(1[32], x)
and the original 1D shape information is lost during the process. When we want to convert the tiled tensor back to pytorch tensor, currently I don't know how to tell if the original shape is 1D.For example, the code below is doing a round-trip conversion between pytorch and ttnn tensor and I expect to get the output
(32,)
but the result is(1, 32)
I think this might be the root cause of the issues like https://github.com/tenstorrent/tt-metal/issues/12671 where we get 2D output on elementwise op with 1D input