qualia_codegen_core.Validator module

class qualia_codegen_core.Validator.TBaseLayerWithActivation(input_shape: qualia_codegen_core.typing.Shapes, output_shape: qualia_codegen_core.typing.Shapes, output_dtype: qualia_codegen_core.typing.DTypes, name: str, activation: 'TActivation')[source]

Bases: TBaseLayer

activation: TActivation
class qualia_codegen_core.Validator.Validator[source]

Bases: object

Class used to validate various parts of the model to make sure they conform to the limitation of the conversion tool.

validate_combined_activation(layer: TBaseLayer) bool[source]
validate_batchnorm(node: LayerNode) bool[source]
validate_flatten(node: LayerNode) bool[source]
validate_global_sum_pooling(node: LayerNode) bool[source]
validate_round_mode(node: LayerNode) bool[source]

Check if layer activation round mode is not None when number_type is int.

Parameters:

node – LayerNode to check the activation round mode of

Returns:

True if layer’s round mode is neither None nor qualia_codegen_core.graph.RoundMode.RoundMode.NONE when layer’s number_type is int, otherwise False

validate_node(node: LayerNode) bool[source]