Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Changelog = "https://github.com/SimplexLab/TorchJD/blob/main/CHANGELOG.md"
[dependency-groups]
check = [
"ruff>=0.14.14",
"ty>=0.0.14",
"ty>=0.0.100",
"pre-commit>=2.9.2", # isort doesn't work before 2.9.2
]

Expand Down Expand Up @@ -200,4 +200,4 @@ exclude = ["src/torchjd/aggregation/_nash_mtl.py"]
[tool.ty.rules]
# nn.Module declares `forward` as a mutable `Callable[..., Any]` attribute, so every
# `forward` override would be flagged.
invalid-mutable-override = "ignore"
incompatible-mutable-override = "ignore"
2 changes: 1 addition & 1 deletion src/torchjd/autogram/_jacobian_computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def vmap(
jac_outputs: tuple[Tensor, ...],
args: tuple[PyTree, ...],
kwargs: dict[str, PyTree],
) -> tuple[Tensor, None]: # ty: ignore[invalid-method-override]
) -> tuple[Tensor, None]: # ty: ignore[incompatible-method-override]
# There is a non-batched dimension
# We do not vmap over the args, kwargs, or rg_outputs for the non-batched dimension
generalized_jacobian = torch.vmap(compute_jacobian_fn, in_dims=in_dims[1:])(
Expand Down
4 changes: 2 additions & 2 deletions src/torchjd/autogram/_module_hook_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def forward(
def setup_context(
ctx: Any,
inputs: tuple,
_,
) -> None: # ty: ignore[invalid-method-override]
output: Any, # noqa: ARG004
) -> None:
ctx.gramian_accumulation_phase = inputs[0]
ctx.gramian_computer = inputs[1]
ctx.args = inputs[2]
Expand Down
2 changes: 1 addition & 1 deletion src/torchjd/autojac/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def get_leaf_tensors(tensors: Iterable[Tensor], excluded: Iterable[Tensor]) -> O

# accumulate_grads contains instances of AccumulateGrad, which contain a `variable` field.
# They cannot be typed as such because AccumulateGrad is not public.
leaves = OrderedSet([g.variable for g in accumulate_grads]) # ty: ignore[unresolved-attribute]
leaves = OrderedSet([g.variable for g in accumulate_grads]) # ty: ignore[missing-attribute]

return leaves

Expand Down
Loading