-
Notifications
You must be signed in to change notification settings - Fork 54
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
Random: Replaced factories.array with DNDarray #960
Random: Replaced factories.array with DNDarray #960
Conversation
GPU cluster tests are currently disabled on this Pull Request. |
CodeSee Review Map:Review in an interactive map View more CodeSee Maps Legend |
@ClaudiaComito @mtar Please tell if any changes are required. |
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.
Please, also look at the comments @ClaudiaComito wrote in the similar PRs #949 and #951 for more tips.
heat/core/random.py
Outdated
return factories.array(data, dtype=x.dtype, is_split=x.split, device=x.device, comm=x.comm) | ||
return DNDarray( | ||
data, | ||
gshape=tuple(data.shape), |
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.
Take a closer look at the gshape
parameter in the documentation of DNDarray and the tensor you derive the shape from.
Hint
PyTorch tensors are local
heat/core/random.py
Outdated
return factories.array(perm, dtype=dtype, device=device, split=split, comm=comm) | ||
return DNDarray( | ||
perm, | ||
gshape=tuple(perm.shape), | ||
dtype=dtype, | ||
device=device, | ||
split=split, | ||
comm=comm, | ||
balanced=True, | ||
) |
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.
Take a look at the split
parameter in the documentation of ht.array and compare it to DNDarray.
Codecov Report
@@ Coverage Diff @@
## main #960 +/- ##
=======================================
Coverage 95.36% 95.36%
=======================================
Files 64 64
Lines 9898 9898
=======================================
Hits 9439 9439
Misses 459 459
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@mtar I have made some changes, could you please review. |
Thank you very much @shahpratham, this looks better now. |
run tests |
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.
Thanks a lot @shahpratham ! Can you update the CHANGELOG?
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.
Well done @shahpratham !
run tests |
Description
Replaced factories.array with DNDarray in random.py
Issue/s resolved: #800
Changes proposed:
Type of change
enhancement
Due Diligence
Does this change modify the behaviour of other functions? If so, which?
no