Skip to content

refactor(autojac): Simplify autojac input utilities - #806

Merged
ValerianRey merged 3 commits into
mainfrom
refactor/autojac-input-utils
Oct 7, 2026
Merged

ValerianRey merged 3 commits into
mainfrom
refactor/autojac-input-utils

Conversation

@ValerianRey

Copy link
Copy Markdown
Member
  • as_checked_ordered_set built OrderedSet(tensors) to check uniqueness, then returned a second, identical OrderedSet(tensors). It now returns the first one. This runs on every backward, jac and mtl_backward call.
  • create_jac_dict imported Diagonalize and Init inside the function, although the module already imports ._transform at the top. They are now part of that top-level import.

There's no circular import: backward and jac work whichever torchjd module is imported first, in fresh interpreters. The autojac, deprecation and import-error tests pass.

🤖 Generated with Claude Code

`as_checked_ordered_set` built the same OrderedSet twice: once to check
uniqueness, and once to return it. `create_jac_dict` imported Diagonalize and
Init inside the function, although the module already imports `._transform`
at the top, so they can be imported there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ValerianRey ValerianRey added package: autojac cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements labels Oct 7, 2026
@github-actions github-actions Bot changed the title Simplify autojac input utilities refactor(autojac): Simplify autojac input utilities Oct 7, 2026
@ValerianRey
ValerianRey marked this pull request as ready for review October 7, 2026 16:05
@ValerianRey
ValerianRey enabled auto-merge (squash) October 7, 2026 16:06
@ValerianRey
ValerianRey merged commit f2bd52d into main Oct 7, 2026
18 checks passed
@ValerianRey
ValerianRey deleted the refactor/autojac-input-utils branch October 7, 2026 18:47
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.

1 participant