torchrec icon indicating copy to clipboard operation
torchrec copied to clipboard

Refactor context handling with explicit naming

Open iamzainhuda opened this issue 1 week ago • 1 comments

Summary: Previously used 0 index to identify default context and [1:] for sub modules, which makes it confusing to understand.

This diff refactors the context handling to use explicit naming:

  • self._default_ctx: The default context for modules without specific configs
  • self._submodule_ctxs: List of contexts for submodule-specific configurations
  • self._ctxs: Combined list for iteration over all contexts

Differential Revision: D88995022

iamzainhuda avatar Dec 11 '25 22:12 iamzainhuda

@iamzainhuda has exported this pull request. If you are a Meta employee, you can view the originating Diff in D88995022.

meta-codesync[bot] avatar Dec 11 '25 22:12 meta-codesync[bot]