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

Supporting sparse #2

Merged
merged 2 commits into from Dec 19, 2020
Merged

Supporting sparse #2

merged 2 commits into from Dec 19, 2020

Conversation

emprice
Copy link
Contributor

@emprice emprice commented Dec 10, 2020

@jcmgray Here is my attempt at implementing sparse support in autoray. Let me know if something needs to be changed significantly -- happy to help make this work.

@codecov
Copy link

codecov bot commented Dec 10, 2020

Codecov Report

Merging #2 (7daa952) into master (ecceb80) will decrease coverage by 0.04%.
The diff coverage is 97.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #2      +/-   ##
==========================================
- Coverage   98.09%   98.04%   -0.05%     
==========================================
  Files           2        2              
  Lines         367      409      +42     
==========================================
+ Hits          360      401      +41     
- Misses          7        8       +1     
Impacted Files Coverage Δ
autoray/autoray.py 98.01% <97.61%> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecceb80...7daa952. Read the comment docs.

Copy link
Owner

@jcmgray jcmgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I was just expecting sparse_transpose but useful to have all these other functions supported too.

As well as minor comment below, if you could just add sparse to this file
https://github.com/jcmgray/autoray/blob/master/deps/requirements-py3.yml
then it can be included in the CI tests.

@@ -48,6 +54,8 @@ def gen_rand(shape, backend, dtype='float64'):
def test_basic(backend, fn):
x = gen_rand((2, 3, 4), backend)
y = ar.do(fn, x)
if (backend is 'sparse') and (fn is 'sum'):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using is for comparing strings works as a quirk of python, but should probably be avoided in favor of ==. (similarly for a few other places below).

@jcmgray
Copy link
Owner

jcmgray commented Dec 19, 2020

I've pushed a few extra changes and am merging, thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants