Skip to content

Remove TensorDict classes#382

Merged
ValerianRey merged 5 commits intomainfrom
remove-tensor-dicts
Jun 3, 2025
Merged

Remove TensorDict classes#382
ValerianRey merged 5 commits intomainfrom
remove-tensor-dicts

Conversation

@ValerianRey
Copy link
Copy Markdown
Contributor

@ValerianRey ValerianRey commented Jun 2, 2025

Addresses #376

This is an alternative to #379 + #380, as it makes mypy happy, it is correct and it is fast. It is more error-prone when writing transforms though, but we rarely write transforms, so we could just be extra careful when this happens.

TODO:

  • Update the docstrings
  • Maybe use a better name than "TD" for dict[Tensor, Tensor]
  • Changelog entry

@ValerianRey ValerianRey added package: autojac cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements labels Jun 2, 2025
@ValerianRey ValerianRey self-assigned this Jun 2, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/torchjd/_autojac/_backward.py 100.00% <100.00%> (ø)
src/torchjd/_autojac/_mtl_backward.py 100.00% <100.00%> (ø)
src/torchjd/_autojac/_transform/__init__.py 100.00% <ø> (ø)
src/torchjd/_autojac/_transform/_accumulate.py 100.00% <100.00%> (ø)
src/torchjd/_autojac/_transform/_aggregate.py 100.00% <100.00%> (ø)
src/torchjd/_autojac/_transform/_base.py 100.00% <100.00%> (ø)
src/torchjd/_autojac/_transform/_diagonalize.py 100.00% <100.00%> (ø)
src/torchjd/_autojac/_transform/_differentiate.py 100.00% <100.00%> (ø)
src/torchjd/_autojac/_transform/_grad.py 100.00% <100.00%> (ø)
src/torchjd/_autojac/_transform/_init.py 100.00% <100.00%> (ø)
... and 3 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ValerianRey ValerianRey mentioned this pull request Jun 2, 2025
@ValerianRey ValerianRey force-pushed the remove-tensor-dicts branch from c50e9af to 897e80c Compare June 3, 2025 21:13
@ValerianRey ValerianRey marked this pull request as ready for review June 3, 2025 22:26
@ValerianRey
Copy link
Copy Markdown
Contributor Author

This makes the creation of transforms a bit harder, and more risky, but at the same time less verbose. I think it's fine, and it leaves the door open for a better solution if we ever have time to spend on that again.

@ValerianRey ValerianRey changed the title Remove TensorDicts Remove TensorDict subclasses Jun 3, 2025
@ValerianRey ValerianRey changed the title Remove TensorDict subclasses Remove TensorDict classes Jun 3, 2025
@ValerianRey ValerianRey merged commit 849d7e7 into main Jun 3, 2025
16 checks passed
@ValerianRey ValerianRey deleted the remove-tensor-dicts branch June 3, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements package: autojac

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants