qualia_codegen_core.Converter module
- class qualia_codegen_core.Converter.NumberType(number_type, width, long_width, min_val, max_val)[source]
Bases:
NamedTuple
Create new instance of NumberType(number_type, width, long_width, min_val, max_val)
- class qualia_codegen_core.Converter.Converter(output_path: Path | None = None)[source]
Bases:
object
- layer_template_files: ClassVar[dict[type[TBaseLayer], str | None]] = {<class 'qualia_codegen_core.graph.layers.TActivationLayer.TActivationLayer'>: 'activation', <class 'qualia_codegen_core.graph.layers.TAddLayer.TAddLayer'>: 'add', <class 'qualia_codegen_core.graph.layers.TAvgPooling1DLayer.TAvgPooling1DLayer'>: 'averagepool1d', <class 'qualia_codegen_core.graph.layers.TAvgPooling2DLayer.TAvgPooling2DLayer'>: 'averagepool2d', <class 'qualia_codegen_core.graph.layers.TBatchNormalization1DLayer.TBatchNormalization1DLayer'>: 'batchnorm1d', <class 'qualia_codegen_core.graph.layers.TBatchNormalization2DLayer.TBatchNormalization2DLayer'>: 'batchnorm2d', <class 'qualia_codegen_core.graph.layers.TConcatenateLayer.TConcatenateLayer'>: 'concatenate', <class 'qualia_codegen_core.graph.layers.TConv1DLayer.TConv1DLayer'>: 'conv1d', <class 'qualia_codegen_core.graph.layers.TConv2DLayer.TConv2DLayer'>: 'conv2d', <class 'qualia_codegen_core.graph.layers.TDenseLayer.TDenseLayer'>: 'fc', <class 'qualia_codegen_core.graph.layers.TFlattenLayer.TFlattenLayer'>: 'flatten', <class 'qualia_codegen_core.graph.layers.TInputLayer.TInputLayer'>: None, <class 'qualia_codegen_core.graph.layers.TMaxPooling1DLayer.TMaxPooling1DLayer'>: 'maxpool1d', <class 'qualia_codegen_core.graph.layers.TMaxPooling2DLayer.TMaxPooling2DLayer'>: 'maxpool2d', <class 'qualia_codegen_core.graph.layers.TPermuteLayer.TPermuteLayer'>: 'permute', <class 'qualia_codegen_core.graph.layers.TSampleNormLayer.TSampleNormLayer'>: 'samplenorm', <class 'qualia_codegen_core.graph.layers.TSliceLayer.TSliceLayer'>: 'slice', <class 'qualia_codegen_core.graph.layers.TSumLayer.TSumLayer'>: 'sum'}
- TEMPLATE_PATH = PosixPath('/home/runner/work/qualia-codegen-core/qualia-codegen-core/src/qualia_codegen_core/assets')
- write_model_header(modelgraph: ModelGraph) str [source]
- write_model(modelgraph: ModelGraph, allocation: dict[str, list[list[LayerNode]] | dict[LayerNode, int]] | None) str [source]
- write_defines_header(modelgraph: ModelGraph) str [source]
- combine_zeropadding(modelgraph: ModelGraph) ModelGraph | None [source]
- remove_dropout(modelgraph: ModelGraph) ModelGraph [source]
- combine_relu(modelgraph: ModelGraph) ModelGraph | None [source]
- remove_identity(modelgraph: ModelGraph) ModelGraph [source]
- rename_operators(modelgraph: ModelGraph) ModelGraph [source]
- optimize_modelgraph(modelgraph: ModelGraph) ModelGraph | None [source]
- preprocess_modelgraph(modelgraph: ModelGraph) ModelGraph | None [source]
- validate_modelgraph(modelgraph: ModelGraph) bool [source]
- quantize_modelgraph(modelgraph: ModelGraph) bool [source]
- generate_code(modelgraph: ModelGraph, allocation: dict[str, list[list[LayerNode]] | dict[LayerNode, int]]) str | None [source]
- convert_model(modelgraph: ModelGraph) str | None [source]