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

add sign, sgn #827

Merged
merged 26 commits into from
Oct 8, 2021
Merged

add sign, sgn #827

merged 26 commits into from
Oct 8, 2021

Conversation

mtar
Copy link
Collaborator

@mtar mtar commented Jun 29, 2021

Description

This PR adds the sign & sgn functions to heat. The former behaves like numpy on complex values, the latter like pytorch.

Note
Requires PyTorch 1.9 Uses a indexing mask on older versions now.

Issue/s resolved: #780

Changes proposed:

  • add sign
  • add sgn

Type of change

  • New feature

Due Diligence

  • All split configurations tested
  • Multiple dtypes tested in relevant functions
  • Documentation updated (if needed)
  • Updated changelog.md under the title "Pending Additions"

Does this change modify the behaviour of other functions? If so, which?

no

@mtar mtar added the API Anything relating the API label Jun 29, 2021
@codecov
Copy link

codecov bot commented Jun 29, 2021

Codecov Report

Merging #827 (5fba209) into master (d00d61e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #827   +/-   ##
=======================================
  Coverage   95.47%   95.48%           
=======================================
  Files          64       64           
  Lines        9436     9454   +18     
=======================================
+ Hits         9009     9027   +18     
  Misses        427      427           
Flag Coverage Δ
gpu 94.61% <100.00%> (+0.01%) ⬆️
unit 91.00% <94.73%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
heat/core/rounding.py 96.96% <100.00%> (+0.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d00d61e...5fba209. Read the comment docs.

@mtar
Copy link
Collaborator Author

mtar commented Jul 7, 2021

test fails on pytorch 1.8.1: nonzero can't be used with complex dtypes

@coquelin77
Copy link
Member

rerun tests

@coquelin77
Copy link
Member

coquelin77 commented Jul 13, 2021

it looks like the tests are failing here because of device mismatches

@coquelin77
Copy link
Member

test fails on pytorch 1.8.1: nonzero can't be used with complex dtypes

this seems to be the case for torch 1.7 as well

@mtar mtar requested a review from coquelin77 July 20, 2021 07:51
@ClaudiaComito ClaudiaComito added this to the 1.2.x milestone Aug 18, 2021
@mtar
Copy link
Collaborator Author

mtar commented Aug 24, 2021

Tests updated for GPU.
Two missing lines in coverage because of code for pytorch 1.9 only.

Copy link
Contributor

@ClaudiaComito ClaudiaComito left a comment

Choose a reason for hiding this comment

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

👏🏼 @mtar thanks a lot as usual. Just a few comments.

heat/core/rounding.py Show resolved Hide resolved
heat/core/rounding.py Show resolved Hide resolved
heat/core/rounding.py Show resolved Hide resolved
heat/core/rounding.py Show resolved Hide resolved
@coquelin77 coquelin77 merged commit 300e05e into master Oct 8, 2021
@coquelin77 coquelin77 deleted the features/780-sign branch October 8, 2021 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Anything relating the API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement square, sign
3 participants