Skip to content
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

Fix formula #3

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/proposals/ONNXMultiDeviceProposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ A key observation in the above example shows how indexing is performed when mult
```
split_tensors = []
for a in range(num_shards_a):
a_index = a * input.shape[axis0] / num_shards_a
a_width = input.shape[axis0] / num_shards_a
a_index = a * a_width
for b in range(num_shards_b):
b_index = b * input.shape[axis1] / num_shards_b
split = input[a_index : a_index + num_shards_a, b_index : b_index + num_shards_b]
b_width = input.shape[axis1] / num_shards_b
b_index = b * b_width
split = input[a_index : a_index + a_width, b_index : b_index + b_width]
split_tensors.append(split)
```

Expand Down
Loading