Skip to content

Namedtuple return for symeig, eig, pstrf, qr, geqrf#16950

Closed
zasdfgbnm wants to merge 15 commits intopytorch:masterfrom
zasdfgbnm:namedtuple-return-qr
Closed

Namedtuple return for symeig, eig, pstrf, qr, geqrf#16950
zasdfgbnm wants to merge 15 commits intopytorch:masterfrom
zasdfgbnm:namedtuple-return-qr

Conversation

@zasdfgbnm
Copy link
Collaborator

More ops for #394

cc: @ezyang

@zasdfgbnm
Copy link
Collaborator Author

Should be working now

variants: method, function

- func: pstrf(Tensor self, bool upper=True, Scalar tol=-1, *, Tensor(a!) u, Tensor(b!) piv) ->(Tensor(a!), Tensor(b!))
- func: pstrf(Tensor self, bool upper=True, Scalar tol=-1, *, Tensor(a!) u, Tensor(b!) piv) ->(Tensor(a!) u, Tensor(b!) piv)
Copy link
Contributor

Choose a reason for hiding this comment

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

@vishwakftw I remember you were interested in cholesky decompositions, what do you think about these names?

Personally I have no clue what these names are but I also don't know anything on the subject

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, u seems right, because pstrf is meant to return upper triangular matrices.

@ezyang
Copy link
Contributor

ezyang commented Feb 13, 2019

@zasdfgbnm what's your opinion on name conflicts between input and output arguments? An alternate resolution is to say that, the output name always has to be distinct from input names (and then we have to pick a name like e and V, which I guess is worse than eigenvalues and eigenvectors for non-mathematicians, but is not totally unprecedented, since we have a bunch of other very shortly named identifiers.)

@ezyang
Copy link
Contributor

ezyang commented Feb 13, 2019

This PR looks functionally correct but I want to discuss the matter of _return some more

@zasdfgbnm
Copy link
Collaborator Author

@ezyang I am OK with short names in general, like Q, R, but personally I don't like the name e and V for this one. Because the e and V are not as widely adopted as something like Q and R for QR decomposition. IMHO, it's good to use abbreviations only when there is a common way to abbreviate.

I don't thin there is a common way to abbreviate eigenvalues and eigenvectors, below are a list of abbreviations in different materials (these are all top ranking result in Google when searching eigen values):

@ezyang
Copy link
Contributor

ezyang commented Feb 14, 2019

SGTM. @soumith suggests we use pivot instead of piv though :)

@zasdfgbnm
Copy link
Collaborator Author

@ezyang Just renamed piv -> pivot

@zasdfgbnm
Copy link
Collaborator Author

Need to rebase after landing #16186, because we need to update the whitelist of the new unit test added in #16186.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

ok

facebook-github-bot pushed a commit that referenced this pull request Feb 20, 2019
Summary: More ops for #394

Differential Revision: D14118645

Pulled By: ezyang

fbshipit-source-id: a98646c3ddcbe4e34452aa044951286dcf9df778
@zasdfgbnm
Copy link
Collaborator Author

landed

@zasdfgbnm zasdfgbnm closed this Feb 21, 2019
@zasdfgbnm zasdfgbnm deleted the namedtuple-return-qr branch February 21, 2019 04:16
@zasdfgbnm
Copy link
Collaborator Author

@ezyang Please review #17093 before #17195. As the more and more operators returning structseq, the test test_namedtuple_return becomes long. I will do a refactor on test_namedtuple_return in #17195 to reduce its size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants