chop.passes.transform.utils

conv_bn_fusion_transform_pass

chop.passes.graph.transforms.utils.conv_bn_fusion_transform_pass(graph, pass_args={})[source]

Perform Conv-BN fusion on the given graph.

Parameters:
  • graph (MaseGraph) – a MaseGraph

  • pass_args (dict, optional) – this pass can take a string argument named “file_name”, defaults to None

Returns:

return a tuple of a MaseGraph and an empty dict (no additional info to return)

Return type:

tuple(MaseGraph, dict)

logicnets_fusion_transform_pass

chop.passes.graph.transforms.utils.logicnets_fusion_transform_pass(graph, pass_args, **_)[source]

onnx_annotate_transform_pass

chop.passes.graph.transforms.utils.onnx_annotate_transform_pass(graph, pass_args)[source]

Convert MaseGraph to ONNX and annotate the relevant layers with sparsity information. The code here is derived from Zhewen’s SparseCNN codebase: https://github.com/Yu-Zhewen/sparseCNN/blob/main/onnx_sparsity_attribute.py

Parameters:
  • graph (MaseGraph) – a MaseGraph

  • pass_args (dict, optional) – this pass can take a string argument named “file_name”, defaults to None

Returns:

return a tuple of a MaseGraph and an empty dict (no additional info to return)

Return type:

tuple(MaseGraph, dict)