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

PyTorch wrapper for SchNet operations #40

Merged
merged 39 commits into from
Jan 24, 2022
Merged

Conversation

raimis
Copy link
Contributor

@raimis raimis commented Nov 15, 2021

  • Wrapper for CFConvNeighbors
  • Wrapper for CFConv
  • Tests
  • Documentation

@raimis raimis force-pushed the pytorch_schnet branch 2 times, most recently from 46c9017 to 242a3cd Compare January 14, 2022 20:01
@raimis raimis marked this pull request as ready for review January 19, 2022 18:10
@raimis raimis requested a review from peastman January 19, 2022 18:10
@raimis
Copy link
Contributor Author

raimis commented Jan 19, 2022

@peastman this is ready for the review.

Comment on lines 33 to 34
using torch::Device;
using torch::Tensor;
Copy link
Member

Choose a reason for hiding this comment

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

The using keyword should never be used in a header file. If you do, it pollutes the namespace of any source file that includes it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are within a namespace, so the mapping is torch::Device --> NNPOps::CFConvNeighbors::Device, not just Device. Also, this header is internal and would be needed for the public API.

Copy link
Member

Choose a reason for hiding this comment

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

I still wouldn't do it. This is just one of those rules of C++ development that it's best to follow consistently. There's little to be gained from breaking it and a lot to lose. Once you write a header file, you never know where someone else might include that file in the future or what assumptions they'll have made.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed that stuff

@peastman
Copy link
Member

This looks really good! I added just a few minor comments.

@peastman
Copy link
Member

Looks good to merge whenever it's ready.

@raimis raimis merged commit 896335f into openmm:master Jan 24, 2022
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.

2 participants