We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_torch
transpose
The following code crashes when trying to convert the output of transpose to a torch tensor:
torch
import pytest import ttnn import torch def test_untilize_hc_transpose(device, use_program_cache): B, C, H, W = 1, 32, 1, 32 input_tensor = torch.range(0, B * C * H * C - 1).reshape([B, C, H, W]) memory_config = ttnn.create_sharded_memory_config( [B, C, nearest_32(H), nearest_32(W)], ttnn.CoreGrid(x=1, y=1), ttnn.ShardStrategy.HEIGHT, ) x = ttnn.from_torch( input_tensor, dtype=ttnn.bfloat16, layout=ttnn.TILE_LAYOUT, device=device, ) x = ttnn.to_memory_config(x, memory_config) x = ttnn.untilize(x) # [1, 32, 1[32], 32] x = ttnn.transpose(x, 1, 2) # [ 1, 1, 32, 32] actual = ttnn.to_torch(x) # ERROR: RuntimeError: shape '[1, 1, 32, 32]' is invalid for input of size 32768 expected = torch.transpose(input_tensor, 1, 2) assert_with_pcc(expected, actual, 0.99999)
The error reported is:
RuntimeError: shape '[1, 1, 32, 32]' is invalid for input of size 32768
The text was updated successfully, but these errors were encountered:
Update: if running in debug mode, we get the same error but in the transpose call.
Sorry, something went wrong.
No branches or pull requests
Summary
The following code crashes when trying to convert the output of
transpose
to atorch
tensor:The error reported is:
The text was updated successfully, but these errors were encountered: