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

Fixed tensor "sample_info" on some saved view samples #2793

Merged
merged 1 commit into from Mar 13, 2024

Conversation

nvoxland-al
Copy link
Contributor

🚀 🚀 Pull Request

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

When saving a view, the sample_info on some tensors are not correctly saved to the view.

Example:

ds = deeplake.load(
    "hub://example/my-dataset",
    read_only=True,
    token=token,
)

view = ds[0:3]
print(view.t1[0].sample_info) # Will print valid sample_info

view.save_view(message='First 3 samples materialized', optimize = True)

view_loaded = ds.load_view(id = ds.get_views()[-1].id)
print(view_loaded.t1[0].sample_info) # Will print empty dict

Things to be aware of

This is a more isolated fix than #2791 which updates one place to also know how to deal with Tensor objects rather than just Sample objects. The more isolated fix won't fix any similar problems that live elsewhere, but also doesn't break other code paths like 2791 was.

Copy link

sonarcloud bot commented Mar 12, 2024

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.92%. Comparing base (f485b02) to head (0536b8b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2793      +/-   ##
==========================================
- Coverage   84.51%   83.92%   -0.59%     
==========================================
  Files         231      231              
  Lines       26466    26468       +2     
==========================================
- Hits        22367    22214     -153     
- Misses       4099     4254     +155     
Flag Coverage Δ
unittests 83.92% <100.00%> (-0.59%) ⬇️

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

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

@nvoxland-al nvoxland-al merged commit 6ce32ef into main Mar 13, 2024
11 of 12 checks passed
@nvoxland-al nvoxland-al deleted the fix_info_tensor2 branch March 13, 2024 16:08
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.

None yet

4 participants