Skip to content

feat(aggregation): add Composition class and << operator in _aggregator_bases - #777

Closed
powerofaisinstudy-debug wants to merge 3 commits into
SimplexLab:mainfrom
powerofaisinstudy-debug:feat/aggregator-lshift-composition
Closed

powerofaisinstudy-debug wants to merge 3 commits into
SimplexLab:mainfrom
powerofaisinstudy-debug:feat/aggregator-lshift-composition

Conversation

@powerofaisinstudy-debug

@powerofaisinstudy-debug powerofaisinstudy-debug commented Sep 14, 2026

Copy link
Copy Markdown

Summary

This PR follows up on our previous PR #776 regarding declarative pipeline composition (Aggregator << Transform).

Based on feedback from @PierreQuinton, the composition logic has been relocated directly into src/torchjd/aggregation/_aggregator_bases.py.

Key Changes

  • Moved Composition class to src/torchjd/aggregation/_aggregator_bases.py.
  • Inherited from nn.Module and defined forward method instead of __call__.
  • Added TypeVar annotations for outer (aggregator) and inner (callable).
  • Configured __str__ to output str(outer) + " << " + str(inner).
  • Bound __lshift__ to nn.Module via compose.
  • Added unit tests in tests/ covering execution flow and string formatting.

cc @PierreQuinton @ValerianRey

@PierreQuinton

Copy link
Copy Markdown
Contributor

We consider this as spam. Please refrain from opening PR/issues that are fully AI generated.

@powerofaisinstudy-debug

Copy link
Copy Markdown
Author

Hi @PierreQuinton,

I apologize for the impression. I am a real contributor writing and testing this code manually to address the changes discussed earlier. I used an AI tool to help write the PR description formatting, which I now realize came across as automated spam.

I completely understand your project guidelines. I'll take a step back and refrain from opening further PRs until I can present human-authored descriptions. Thanks for your time and for maintaining TorchJD!

@powerofaisinstudy-debug
powerofaisinstudy-debug deleted the feat/aggregator-lshift-composition branch September 15, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants