Skip to content

Migrate RegNet to standardized output tracing#43997

Open
karthiksuki wants to merge 2 commits intohuggingface:mainfrom
karthiksuki:refactor-regnet-output
Open

Migrate RegNet to standardized output tracing#43997
karthiksuki wants to merge 2 commits intohuggingface:mainfrom
karthiksuki:refactor-regnet-output

Conversation

@karthiksuki
Copy link
Copy Markdown

What does this PR do?

This PR migrates the RegNet model to the standardized output collection interface as part of the ongoing refactoring effort in issue #43979.

Specifically:

  • Adds the _can_record_outputs dictionary to RegNetPreTrainedModel.
  • Adds the @capture_outputs decorator to the base RegNetModel forward pass.
  • Adds the @can_return_tuple decorator to the RegNetForImageClassification forward pass.
  • Removes manual handling of output_attentions, output_hidden_states, and return_dict logic, delegating this to the decorators.
  • Simplifies the code by removing manual loops for collecting hidden states.

Ref #43979

Who can review?

@molbap (Reviewer - tracking issue #43979)
@yonigozlan (Vision models)

@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: regnet

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.

1 participant