afe.tvm_converter ================= .. py:module:: afe.tvm_converter Submodules ---------- .. toctree:: :maxdepth: 1 /pages/api_reference/python-autoapi/afe/tvm_converter/custom_convert_maps/index /pages/api_reference/python-autoapi/afe/tvm_converter/parameters/index /pages/api_reference/python-autoapi/afe/tvm_converter/quantization/index Functions --------- .. autoapisummary:: afe.tvm_converter.serialize_irmod Package Contents ---------------- .. py:function:: serialize_irmod(mod: afe._tvm._defines.TVMIRModule, model_name: str, show_partition: bool = True, output_directory: str = '', is_quantized: bool = False) -> None TODO(Joey.Chou): Use global config to assign backend_checkers and partitioner TODO(Joey.Chou): Rewrite the serialization using a TVM visitor TODO: Instead of serialize_irmod partitioning the irmodule, it should take in custom names for each expression in the network. We can then move the partitioning logic outside of the function. Serializes an IRModule to a JSON file compatible with Netron. Please pass the IRModule through the GraphTransformer() (in afe._tvm._transformer) before passing it into serialize_irmod If show_partition is True, serialize_irmod() will apply backend checkers and partitioner to partition the IR Module. The expressions in the partitioned IR Module will be visualized with a name as below: "{BACKEND_NAME} / {EXPRESSION_NAME}_{INDEX}" * Default backend checkers = [MLAChecker, EVChecker, APUChecker, CPUChecker] * Default partitioner = GreedyPartitioner([Backend.MLA, Backend.EV, Backend.APU, Backend.CPU]) :param mod: TVMIRModule :param model_name: str. Name of the model. Will be used to name the JSON file. :param show_partition: bool. Default is False. :param output_directory: str. Name of the output folder. Default = "" :param is_quantized: bool. Whether the model is quantized. Default is False.