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

Implement squeeze and reshape. #991

Merged
merged 6 commits into from
May 7, 2024
Merged

Implement squeeze and reshape. #991

merged 6 commits into from
May 7, 2024

Conversation

1uc
Copy link
Collaborator

@1uc 1uc commented May 6, 2024

These methods allow reshaping the memory space. This can be used as
an alternative to broadcasting.

Example:

Let dset be a dataset with shape [3, 1, 1]. Then,

dset.reshapeMemSpace({3}).read<std::vector<double>>();
dset.squeezeMemSpace({1, 2}).read<std::vector<double>>();

can be used to read into a one-dimensional dataset.

@1uc
Copy link
Collaborator Author

1uc commented May 6, 2024

This is preparatory work to allow #992.

1uc added 5 commits May 6, 2024 17:23
These methods allow reshaping the memory space. This can be used as
an alternative to broadcasting.

Example:

Let `dset` be a dataset with shape `[3, 1, 1]`. Then,

    dset.reshapeMemSpace({3}).read<std::vector<double>>();
    dset.squeezeMemSpace({1, 2}).read<std::vector<double>>();

can be used to read into a one-dimensional dataset.
@codecov-commenter
Copy link

codecov-commenter commented May 6, 2024

Codecov Report

Attention: Patch coverage is 83.75000% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 86.26%. Comparing base (070badf) to head (1f09187).
Report is 1 commits behind head on master.

Files Patch % Lines
src/examples/broadcasting_arrays.cpp 0.00% 9 Missing ⚠️
include/highfive/bits/H5Attribute_misc.hpp 72.72% 3 Missing ⚠️
include/highfive/bits/H5Slice_traits_misc.hpp 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #991      +/-   ##
==========================================
- Coverage   86.31%   86.26%   -0.05%     
==========================================
  Files          92       94       +2     
  Lines        5919     5986      +67     
==========================================
+ Hits         5109     5164      +55     
- Misses        810      822      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@1uc 1uc marked this pull request as ready for review May 7, 2024 06:40
Copy link
Member

@matz-e matz-e left a comment

Choose a reason for hiding this comment

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

LGTM

@1uc 1uc merged commit d79b5ac into master May 7, 2024
36 checks passed
@1uc 1uc deleted the 1uc/squeeze-reshape branch May 7, 2024 16:03
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.

3 participants