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
Unsorted_segment_sum and unittest #3430
Conversation
@rbharath Ready for review. |
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.
Have a few comments below. Have also turned on the CI to run
deepchem/utils/pytorch_utils.py
Outdated
# Shape of segment_ids should be equal to first dimension of data | ||
assert segment_ids.shape[-1] == data.shape[0] | ||
|
||
if len(segment_ids.shape) == 1: |
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.
You can remove this if statement because of the earlier assert
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.
Removed
@rbharath 21 tests are successful and 10 are failing. I have checked that the tests are not failing because of unsorted_segment_sum. Can you please re-review the PR? |
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.
LGTM
Description
Adding unsorted_segment_sum function in pytorch_utils.py
Type of change
Please check the option that is related to your PR.
Checklist
yapf -i <modified file>
and check no errors (yapf version must be 0.32.0)mypy -p deepchem
and check no errorsflake8 <modified file> --count
and check no errorspython -m doctest <modified file>
and check no errors