ml_switcheroo.plugins.io_handler¶

Plugin for handling Input/Output (IO) Serialization.

Delegates serialization logic to the target FrameworkAdapter to ensure logic remains decoupled from the core transpiler.

Supported: - torch.save(obj, f) rewriting. - torch.load(f) rewriting. - Arg extraction from keyword or positional parameters. - Automatic preamble injection via Adapter request.

Functions¶

transform_io_calls(→ libcst.Call)

Hook to rewrite save/load calls using Adapter-specific logic.

Module Contents¶

ml_switcheroo.plugins.io_handler.transform_io_calls(node: libcst.Call, ctx: ml_switcheroo.core.hooks.HookContext) → libcst.Call¶

Hook to rewrite save/load calls using Adapter-specific logic.

Triggers:

torch.save and torch.load.