-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
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
#14448: Update examples of binary ops #14468
Conversation
>>> tensor1 = ttnn.to_device(ttnn.from_torch(torch.tensor((1, 2), dtype=torch.bfloat16)), device) | ||
>>> tensor2 = ttnn.to_device(ttnn.from_torch(torch.tensor((0, 1), dtype=torch.bfloat16)), device) | ||
>>> tensor1 = ttnn.to_device(ttnn.from_torch(torch.tensor(([[1, 2], [3, 4]]), dtype=torch.bfloat16)), device) | ||
>>> tensor2 = ttnn.to_device(ttnn.from_torch(torch.tensor(([[1, 2], [3, 4]]), dtype=torch.bfloat16)), device) | ||
>>> output = {1}(tensor1, tensor2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the issue ? Is it zero or the format how it passed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format that we passed.
torch.tensor((1, 2), dtype=torch.bfloat16)
creates a tensor of rank 1 with elements [1 2].
According to the documentation, most of the ops support ranks of 2, 3, 4. That's why we passed the input as
[1 2
3 4]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
345d5ee
to
f8de925
Compare
f8de925
to
a1eb0fa
Compare
tenstorrent#14448: Update examples, wordings of binary ops
Ticket
#14448
Problem description
Shape in examples inconsistent with op.
Currently we support device operations for ranks > 2 as per doc. The example in the doc creates a 1D tensor.
What's changed
Checklist