Skip to content

Conversation

@vishwakftw
Copy link
Contributor

Changelog:

  • Enable broadcasting of RHS and LHS tensors for lu_solve. This means that you can now have RHS with size 3 x 2 and LHS with size 4 x 3 x 3 for instance
  • Remove deprecated behavior of having 2D tensors for RHS. Now all tensors have to have a last dimension which equals the number of right hand sides
  • Modified docs

Test Plan:

  • Add tests for new behavior in test_torch.py with a port to test_cuda.py

Changelog:
- Enable broadcasting of RHS and LHS tensors for lu_solve. This means that you can now have RHS with size `3 x 2` and LHS with size `4 x 3 x 3` for instance
- Remove deprecated behavior of having 2D tensors for RHS. Now all tensors have to have a last dimension which equals the number of right hand sides
- Modified docs

Test Plan:
- Add tests for new behavior in test_torch.py with a port to test_cuda.py
@pytorchbot pytorchbot added module: cuda Related to torch.cuda, and CUDA support in general module: docs Related to our documentation, both in docs/ and docblocks module: operators labels Aug 14, 2019
@vishwakftw vishwakftw requested a review from zou3519 August 14, 2019 18:25
@vishwakftw
Copy link
Contributor Author

@pytorchbot rebase this please

@vishwakftw
Copy link
Contributor Author

@pytorchbot rebase this please

Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

Code looks correct. I had some comments on style and cleaning up the testing code

@pytorchbot pytorchbot added the module: tests Issues related to tests (not the torch.testing module) label Aug 20, 2019
@vishwakftw
Copy link
Contributor Author

@zou3519 I actually missed out on adding tests for broadcasting behavior earlier. I've added them now, just FYI.

@vishwakftw
Copy link
Contributor Author

@zou3519 except for test refactoring and specifying sizes in error message (which will be addressed in follow-up PRs), the PR should be good to review again.

@vishwakftw vishwakftw requested a review from zou3519 August 20, 2019 21:24
return torch.stack(all_matrices).reshape(*(batches + (l, l)))


def random_linalg_solve_processed_inputs(A_dims, b_dims, gen_fn, transform_fn, cast_fn):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once this PR is merged, I will use this function in other places in the test suite for *solve methods. This would reduce duplication of code.

@vishwakftw
Copy link
Contributor Author

@pytorchbot rebase this please

Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

Thank you, the code looks a lot better now :)
I had some last comments about repetitiveness in the testing code

@vishwakftw
Copy link
Contributor Author

@pytorchbot rebase this please

@vishwakftw vishwakftw requested a review from zou3519 August 30, 2019 13:30
Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

Nice! Thank you

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.

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

@vishwakftw vishwakftw deleted the lu_solve-new-version branch September 3, 2019 22:18
zdevito pushed a commit to zdevito/ATen that referenced this pull request Sep 3, 2019
…lve (#24333)

Summary:
Changelog:
- Enable broadcasting of RHS and LHS tensors for lu_solve. This means that you can now have RHS with size `3 x 2` and LHS with size `4 x 3 x 3` for instance
- Remove deprecated behavior of having 2D tensors for RHS. Now all tensors have to have a last dimension which equals the number of right hand sides
- Modified docs
Pull Request resolved: pytorch/pytorch#24333

Test Plan: - Add tests for new behavior in test_torch.py with a port to test_cuda.py

Differential Revision: D17165463

Pulled By: zou3519

fbshipit-source-id: cda5d5496ddb29ed0182bab250b5d90f8f454aa6
@facebook-github-bot
Copy link
Contributor

@zou3519 merged this pull request in 1e4832f.

facebook-github-bot pushed a commit that referenced this pull request Sep 11, 2019
Summary:
Changelog:
- De-duplicate the code in tests for torch.solve, torch.cholesky_solve, torch.triangular_solve
- Skip tests explicitly if requirements aren't met for e.g., if NumPy / SciPy aren't available in the environment
- Add generic helpers for these tests in test/common_utils.py
Pull Request resolved: #25733

Test Plan:
- All tests should pass to confirm that the change is not erroneous

Clears one point specified in the discussion in #24333.

Differential Revision: D17315330

Pulled By: zou3519

fbshipit-source-id: c72a793e89af7e2cdb163521816d56747fd70a0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: cuda Related to torch.cuda, and CUDA support in general module: docs Related to our documentation, both in docs/ and docblocks module: tests Issues related to tests (not the torch.testing module) open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants