- 
                Notifications
    
You must be signed in to change notification settings  - Fork 16
 
          ENH: vectorize cov
          #507
        
          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
base: main
Are you sure you want to change the base?
  
    ENH: vectorize cov
  
  #507
              
            Conversation
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.
Should address the lint failures.
| if xp.isdtype(m_transpose.dtype, "complex floating"): | ||
| m_transpose = xp.conj(m_transpose) | ||
| c = m @ m_transpose | ||
| c = xp.matmul(m, m_transpose) | 
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 the reason for this change?
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.
TBH I didn't know they were supposed to be equivalent until after looking it up. I wasn't sure what @ did for n-D arrays, and matmul is a lot easier to look up
If @ really does work like it should for all backends, it can be left alone. Do you know? If not, safer to use the function because it can be updated by array_api_compat.
| fact = 0 | ||
| 
               | 
          ||
| m -= avg[:, None] | ||
| m_transpose = m.T | 
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.
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.
That's not implemented in all backends yet (at least not CuPy and dask.array on colab) and it can't be added by array_api_compat.
Closes gh-502