modeci_mdf.interfaces.pytorch.importer.translate_graph

modeci_mdf.interfaces.pytorch.importer.translate_graph(graph: Union[Graph, Block], mdf_graph: Graph, consts: Dict[str, Any], port_mapper: PortMapper)[source]

Go through a Graph or Block and translate the nodes and edges to MDF nodes and edges.

Parameters:
  • graph – The graph to translate.

  • mdf_graph – The MDF graph to store the translation into.

  • consts – Constant to use for parameters of nodes.

  • port_mapper – A port mapper instance to handle translating names.

Returns: