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

meshgrid implementation #794

Merged
merged 9 commits into from
Jun 30, 2021
Merged

meshgrid implementation #794

merged 9 commits into from
Jun 30, 2021

Conversation

mtar
Copy link
Collaborator

@mtar mtar commented Jun 14, 2021

Description

Implements meshgrid functionality to Heat. It uses the pytorch function of the same name. That function does not support the indexing parameter. As a hotfix for now, the first and second vector are switched during computation when using 'xy'. If the split is on the first or second axis, they are resplitted beforehand.

Issue/s resolved: #775

Changes proposed:

  • add meshgrid function

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 enhancement New feature or request label Jun 14, 2021
@codecov
Copy link

codecov bot commented Jun 14, 2021

Codecov Report

Merging #794 (e5b12fa) into master (f7f6c35) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #794      +/-   ##
==========================================
+ Coverage   95.29%   95.31%   +0.01%     
==========================================
  Files          64       64              
  Lines        8972     9000      +28     
==========================================
+ Hits         8550     8578      +28     
  Misses        422      422              
Flag Coverage Δ
gpu 94.44% <100.00%> (+0.01%) ⬆️
unit 90.90% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
heat/core/factories.py 100.00% <100.00%> (ø)

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 f7f6c35...e5b12fa. Read the comment docs.

@mtar mtar marked this pull request as ready for review June 14, 2021 10:29
@mtar mtar marked this pull request as draft June 15, 2021 07:52
@mtar mtar marked this pull request as ready for review June 15, 2021 08:21
@mtar mtar added the API Anything relating the API label Jun 16, 2021
grids = list(grids)
grids[0], grids[1] = grids[1], grids[0]

return list(asarray(grid, is_split=splitted) for grid in grids)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use DNDarray() here instead of asarray()?

Copy link
Member

@coquelin77 coquelin77 left a comment

Choose a reason for hiding this comment

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

looks good. only minor changes

heat/core/factories.py Show resolved Hide resolved
heat/core/tests/test_factories.py Outdated Show resolved Hide resolved
@coquelin77 coquelin77 merged commit 83ec24a into master Jun 30, 2021
@coquelin77 coquelin77 deleted the feature/775-meshgrid branch June 30, 2021 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Anything relating the API enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement meshgrid
3 participants