Skip to content

[ResNet] Refactor output tracing to decorator-based interface#44007

Open
pdwi2020 wants to merge 4 commits intohuggingface:mainfrom
pdwi2020:codex/transformers-output-tracing-resnet
Open

[ResNet] Refactor output tracing to decorator-based interface#44007
pdwi2020 wants to merge 4 commits intohuggingface:mainfrom
pdwi2020:codex/transformers-output-tracing-resnet

Conversation

@pdwi2020
Copy link
Copy Markdown

Summary

  • refactor ResNetModel to use @capture_outputs for hidden-state collection
  • register _can_record_outputs on ResNetPreTrainedModel with ResNetStage
  • switch ResNetForImageClassification and ResNetBackbone to @can_return_tuple and remove manual return_dict branching
  • preserve existing hidden-state behavior while simplifying output handling

Closes #43979 for resnet.

Validation

  • python3 -m compileall src/transformers/models/resnet/modeling_resnet.py
  • full model tests were not run in this environment due missing optional test dependency (regex)

@Rocketknight1
Copy link
Copy Markdown
Member

cc @molbap

@github-actions
Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: regnet, resnet, rt_detr

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.

Call to contributions: refactor output tracing in transformers

2 participants