modeci_mdf.interfaces.pytorch.exporter.build_script(nodes: List[node], execution_order: List[str], model_id1: str, d_e: Dict[str, Any], conditions, version: str)[source]

Helper function to create and assemble text components necessary to specify importable model script. These include:

  • Module declarations
    • Initialization of functions

    • Definition of forward function

  • Model main call declaration:
    • Initialization of subcomponents

    • Forward function logic

  • nodes – list of nodes in the graph

  • execution_order – List of nodes in the order of execution

  • d_e – Weights on edges stored in dict format

  • model_id1 – id of the model to be converted

  • conditions

Returns: complete script as a formatted string