Skip to content

test: Remove trivial ShapedModules#461

Merged
ValerianRey merged 1 commit intomainfrom
remove-trivial-shaped-modules
Oct 16, 2025
Merged

test: Remove trivial ShapedModules#461
ValerianRey merged 1 commit intomainfrom
remove-trivial-shaped-modules

Conversation

@ValerianRey
Copy link
Contributor

@ValerianRey ValerianRey commented Oct 16, 2025

  • Add support for RNN, BatchNorm2d and InstanceNorm2d in get_in_out_shapes
  • Remove WithRNN, WithBatchNorm and WithModuleTrackingRunningStats - use simple factories instead

Whenever a ShapedModule is simply a wrapper around a single nn.Module, we can replace it by a line in get_in_out_shapes and make a factory directly out of the nn.Module. It's not strictly equivalent (because now the module isn't wrapped), but it's closer to what a user would do.

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ValerianRey ValerianRey changed the title test: Remove trivial ShapedModules test: Remove trivial ShapedModules Oct 16, 2025
@ValerianRey ValerianRey force-pushed the remove-trivial-shaped-modules branch 2 times, most recently from 0f4b69d to e7250a9 Compare October 16, 2025 23:27
* Add support for RNN, BatchNorm2d and InstanceNorm2d in get_in_out_shapes
* Remove WithRNN, WithBatchNorm and WithModuleTrackingRunningStats - use simple factories instead
* Whenever a ShapedModule is simply a wrapper around a single nn.Module, we can replace it by a line in get_in_out_shapes and make a factory directly out of the nn.Module. It's not strictly equivalent (because now the module isn't wrapped), but it's closer to what a user would do.
@ValerianRey ValerianRey force-pushed the remove-trivial-shaped-modules branch from e7250a9 to 5fec5f7 Compare October 16, 2025 23:29
@ValerianRey
Copy link
Contributor Author

@PierreQuinton FYI, this is how you can test any nn.Module now.

@ValerianRey ValerianRey self-assigned this Oct 16, 2025
@ValerianRey ValerianRey added the cc: test Conventional commit type for changes to tests. label Oct 16, 2025
@ValerianRey ValerianRey merged commit aff0abc into main Oct 16, 2025
17 checks passed
@ValerianRey ValerianRey deleted the remove-trivial-shaped-modules branch October 16, 2025 23:34
ValerianRey added a commit that referenced this pull request Oct 20, 2025
* Add support for RNN, BatchNorm2d and InstanceNorm2d in get_in_out_shapes
* Remove WithRNN, WithBatchNorm and WithModuleTrackingRunningStats - use simple factories instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: test Conventional commit type for changes to tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant