torchrec
torchrec copied to clipboard
Refactor context handling with explicit naming
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 configsself._submodule_ctxs: List of contexts for submodule-specific configurationsself._ctxs: Combined list for iteration over all contexts
Differential Revision: D88995022
@iamzainhuda has exported this pull request. If you are a Meta employee, you can view the originating Diff in D88995022.