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

LinearOperator should have ndim attribute #11908

Closed
PavelStishenko opened this issue Apr 21, 2020 · 2 comments
Closed

LinearOperator should have ndim attribute #11908

PavelStishenko opened this issue Apr 21, 2020 · 2 comments
Labels
enhancement A new feature or improvement
Milestone

Comments

@PavelStishenko
Copy link
Contributor

Is your feature request related to a problem? Please describe.

In some cases LinearOperator can not be used in place of matrices because it doesn't have ndim attribute.

Describe the solution you'd like

It would be convenient, if LinearOperator had ndim attribute, that is always equal 2.

Describe alternatives you've considered

The simplest alternative is len(op.shape), but it looks worse than op.ndim.
Also here scikit-learn/scikit-learn#16463 (comment) folks worry about performance penalty.

Additional context (e.g. screenshots)

@pv
Copy link
Member

pv commented Apr 21, 2020 via email

@PavelStishenko
Copy link
Contributor Author

Should be simple to add (class attribute). PR welcome (with test added preferable).

OK, I will make a PR ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement
Projects
None yet
Development

No branches or pull requests

3 participants