Repository navigation
Fix ledidi() y_bar shape for ledidi>=2.2.0 - #200
Merged
Merged
Conversation
ledidi>=2.2.0 validates that y_bar has a leading batch dimension of size 1, which a 0-dim scalar tensor fails. loss_func ignores the target value entirely, so torch.tensor([0]) works as a shape-compliant placeholder under both ledidi 2.1.0 and 2.2.0. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ledidi>=2.2.0validates thaty_barpassed toLedidi.fit_transformhas a leading batch dimension of size 1; a 0-dim scalar tensor fails that check withIndexError: tuple index out of range.grelu.design.ledidi()'s customloss_funcignores the target value entirely (it only maximizes the model's own prediction), soy_baris just a placeholder — switching it fromtorch.tensor(0)totorch.tensor([0])satisfies the new validation without changing behavior.Test plan
tests/test_design.py::test_ledidipasses withledidi==2.1.0tests/test_design.py::test_ledidipasses withledidi==2.2.0(the version installed by CI, sinceledidiis unpinned insetup.cfg)🤖 Generated with Claude Code