modeci_mdf.interfaces.pytorch.importer
Functions for converting from PyTorch TorchScript to MDF models.
This code was originally inspired by the following blog post:
Mike He, “From Models to Computation Graphs (Part I)”, https://ad1024.space/articles/22
Functions
|
Helper function that converts some common unserializable types to JSON seriralizable types |
|
Find all constant nodes in the graph and extract their values as a proper JSON serializable value. |
|
Helper function to get a unique name (used in MDF as id) for a TorchScript node's op/function. |
|
Helper function that generates a clean graph and model name from a TorchScript model |
|
Helper function to get a unique name (used in MDF as id) from a TorchScript Node object |
|
Retrieve the argument names and attributes (parameters in MDF) for this Operation. |
|
Parse a TorchScript node schema into argument names and constant attributes (parameters in MDF) |
|
Convert a PyTorch model to an MDF model. |
|
Convert a TorchScript node to an MDF node. |
|
Go through a |
Classes
|
A simple class that handles mapping TorchScript inputouput ids to MDF InputPortOutputPort ids. |