8000 Ignore some type errors by ValerianRey · Pull Request #370 · TorchJD/torchjd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ignore some type errors #370

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

Merged
merged 4 commits into from
Jun 2, 2025
Merged

Ignore some type errors #370

merged 4 commits into from
Jun 2, 2025

Conversation

ValerianRey
Copy link
Contributor
@ValerianRey ValerianRey commented May 29, 2025

Some type errors are simply not worth the time to fix. This includes:

  • NashMTL (there are way too errors, and they would be hard to fix)
  • Assignment to gamma in MGDA (it's supposed to be a float but we assign a Tensor (containing a single float) to it). We will solve that if we ever re-implement MGDA anyway.
  • TensorDict immutability tricks: these tricks break the Liskov Substition Principle anyway, so there's no way to fix the core issue without completely changing TensorDicts. The current solution works though, and alternatives seem really bad or slow, so I really don't think it's worth changing anything. I still added a comment to be clear about the fact this trick breaks LSP.

  • Add comment to ignore mypy errors in _nash_mtl.py
  • Add comment to ignore type error in mgda
  • Add type: ignore[assignment] when needed in TensorDict immutability tricks, and add a comment

@ValerianRey ValerianRey self-assigned this May 29, 2025
@ValerianRey ValerianRey mentioned this pull request May 29, 2025
Copy link
codecov bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/torchjd/_autojac/_transform/_tensor_dict.py 100.00% <100.00%> (ø)
src/torchjd/aggregation/_mgda.py 100.00% <100.00%> (ø)
src/torchjd/aggregation/_nash_mtl.py 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This was referenced May 29, 2025
@ValerianRey ValerianRey merged commit 75ef97a into main Jun 2, 2025
16 checks passed
@ValerianRey ValerianRey deleted the ignore-some-type-errors branch June 2, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0