Added _contract_iter3 utility to simplify iteration space over 3 arrays#1044
Merged
oleksandr-pavlyk merged 1 commit intomasterfrom Jan 26, 2023
Merged
Added _contract_iter3 utility to simplify iteration space over 3 arrays#1044oleksandr-pavlyk merged 1 commit intomasterfrom
oleksandr-pavlyk merged 1 commit intomasterfrom
Conversation
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/1044/index.html |
Collaborator
|
Array API standard conformance tests for dpctl=0.14.1dev1=py310h76be34b_31 ran successfully. |
``` In [1]: import dpctl.tensor as dpt, dpctl.tensor._tensor_impl as ti, dpctl In [4]: import itertools In [5]: ti._contract_iter2((2, 5, 3), (15, -3, 1), (0,0,1)) Out[5]: ([10, 3], [3, 1], -12, [0, 1], 0) In [6]: or_s = set( (15*i0 - 3*i1 + i2, i2, 15*i0 - 3*i1 + i2) for i0,i1,i2 in itertools.product(range(2), range(5), range(3)) ) In [7]: alt_s = set( (3*i0 + i1 - 12, i1, 3*i0 + i1 - 12) for i0,i1 in itertools.product(range(10), range(3)) ) In [8]: or_s == alt_s Out[8]: True ```
61e1ea9 to
e5c7552
Compare
|
Array API standard conformance tests for dpctl=0.14.1dev1=py310h76be34b_31 ran successfully. |
|
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
|
Array API standard conformance tests for dpctl=0.14.1dev1=py310h76be34b_45 ran successfully. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
dpctl.tensor._tensor_impl._contract_iter3utility to simplify iteration space over indices of 3 arrays with the same shape, but possibly different strides.This utility is going to be useful in implementation of binary functions,
_binary_func( in1, in2, out), example of which isout = in1 + in2.