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

fix/typing(layer_set): Allow layer set read_proc to return single layer #761

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nkemnitz
Copy link
Collaborator

@nkemnitz nkemnitz commented Aug 2, 2024

Allows combining two layers with a read_proc, e.g. https://github.com/ZettaAI/specs/blob/main/nico/inference/chen_s1/11_fine_align_pairwise.cue#L196-L223

Already worked before, just the static type checker would complain.

@nkemnitz
Copy link
Collaborator Author

nkemnitz commented Aug 2, 2024

Tests fail to unrelated zetta_utils/internal/segmentation/embedding/utils.py:117: error: Argument 1 to "_compute_affinity" has incompatible type "ndarray[Any, dtype[Any]]"; expected "Tensor" [arg-type]

@supersergiy
Copy link
Member

I think Ideally we would want to handle it in a way that would still keep the return type of layer set's __getitem__ predictable. With this change, every time a user reads from a layer set in python they would have to assert the expected return type. Let me think about this a bit...

@nkemnitz nkemnitz force-pushed the nkem/typing-layerset-to-layer branch from 245cd92 to 974ea6b Compare August 30, 2024 11:34
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (056e9ad) to head (dc38ed6).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #761   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          142       142           
  Lines         5877      5877           
=========================================
  Hits          5877      5877           

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

@nkemnitz
Copy link
Collaborator Author

Any update here?

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.

2 participants