-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement tensordot
and repeat
#95
Implement tensordot
and repeat
#95
Conversation
Signed-off-by: neNasko1 <[email protected]>
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.
I'll need to play around with the einsum a little more but here's a first pass.
Co-authored-by: Aditya Goel <[email protected]>
xfails.txt
Outdated
array_api_tests/test_manipulation_functions.py::test_repeat | ||
# segmentation fault: due to onnxruntime not handling einsum with dim 0 | ||
array_api_tests/test_linalg.py::test_tensordot |
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.
If these tests segfault then we should put them into skips.txt rather than here. That the array-api-tests are green nonetheless is an indication that something else is fishy. That feeling is confounded by the fact that they finish within 20s. Could you take a look, please?
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.
I think we're almost there. Not sure I get what your lazy_repeats
test is doing.
tests/test_core.py
Outdated
(np.arange(60).reshape(3, 4, 5), np.arange(60), None), | ||
], | ||
) | ||
def test_repeat(a, repeats, axis, lazy_repeats): |
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 is "lazy" about the lazy_repeats
case here? Even when repeats
is int
, it's immediately wrapped in ndx.asarray(repeats)
in your implementation of repeat
.
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.
For a test that exercises shape inference for repeat
, ideally you should be using a lazy array and just building the ONNX model.
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 idea of the test is to test that if we actually supply the argument as a python integer, we wrap it correctly. I rewrote the test to be cleaner.
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.
@neNasko1 please rebase
Signed-off-by: Atanas Dimitrov <[email protected]>
Thanks for merging into main! |
Signed-off-by: Atanas Dimitrov <[email protected]>
This PR adds implementations to tensordot and repeat.
Note they currently segfault on the latest onnx release, so the arrayapi tests are disabled. Coverage is provided instead on our side with some tests.