warp.capture_save#

warp.capture_save(graph, path, inputs=None, outputs=None)[source]#

Serialize a captured graph to a .wrp file for later replay.

The graph must have been captured with apic=True.

Parameters:
  • graph (Graph) – A Graph captured with apic=True.

  • path (str) – Output path (without extension). Creates {path}.wrp and {path}_modules/.

  • inputs (dict | None) – Named input arrays (e.g., {"positions": pos_array}).

  • outputs (dict | None) – Named output arrays (e.g., {"results": result_array}).

If the same array appears in both inputs and outputs (e.g., for in-place operations), both names will refer to the same memory region. Updating either via set_param on the loaded graph affects the same data.