Skip to content

Commit

Permalink
#12557: bias shape was wrong, and need to create pure torch tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
mywoodstock committed Sep 19, 2024
1 parent ca03e4d commit e2b37ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/ttnn/unit_tests/operations/test_conv1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def run_conv(
torch.manual_seed(0)
conv_input_shape = [batch_size, input_channels, input_length]
conv_weight_shape = [output_channels, input_channels // groups, kernel_size]
conv_bias_shape = [1, 1, output_channels]
conv_bias_shape = [1, 1, 1, output_channels]
torch_input_tensor_ncl = torch.randn(conv_input_shape, dtype=torch.bfloat16).float()
torch_input_tensor = torch.permute(torch_input_tensor_ncl, (0, 2, 1))
torch_weight_tensor = torch.randn(conv_weight_shape, dtype=torch.bfloat16).float()
Expand Down Expand Up @@ -118,7 +118,7 @@ def run_conv(
)

tt_output_tensor = ttnn.from_device(tt_output_tensor_on_device)
torch_output_tensor = ttnn.to_torch(tt_output_tensor)
torch_output_tensor = torch.Tensor(ttnn.to_torch(tt_output_tensor))

# torch_output_tensor is in row major layout and NLC shape
# NLC to NCL
Expand Down

0 comments on commit e2b37ab

Please sign in to comment.