finn.transformation.general (module)¶
-
class
finn.transformation.general.ApplyConfig(config)¶ Bases:
finn.transformation.base.TransformationApplies node properties (attributes) from either a config dict or its JSON representation given as a filename. The JSON file can specify default values for particular op_types, as well as values for nodes with particular names. Example dict:
{ # set kernel_size = 3 for all nodes with op_type=Im2Col "Defaults" : {"kernel_size" : [3, ["Im2Col"]]}, # set kernel_size = 7 for the particular node with name Im2Col_0 "Im2Col_0" : {"kernel_size" : 7} }
-
apply(model)¶
-
-
class
finn.transformation.general.ConvertDivToMul¶ Bases:
finn.transformation.base.TransformationConvert divide by constant nodes to multiply by constant nodes.
-
apply(model)¶
-
-
class
finn.transformation.general.ConvertSubToAdd¶ Bases:
finn.transformation.base.TransformationConvert subtract-a-constant nodes to add-a-constant nodes.
-
apply(model)¶
-
-
class
finn.transformation.general.GiveRandomTensorNames¶ Bases:
finn.transformation.base.TransformationGive random tensor names to all tensors.
-
apply(model)¶
-
-
class
finn.transformation.general.GiveReadableTensorNames¶ Bases:
finn.transformation.base.TransformationGive more human-readable names to all internal tensors. You should apply GiveUniqueNodeNames prior to this transform to avoid empty node names, as the readable names are based on the node names.
-
apply(model)¶
-
-
class
finn.transformation.general.GiveUniqueNodeNames(prefix='')¶ Bases:
finn.transformation.base.TransformationGive unique names to each node in the graph using enumeration, starting with given prefix (if specified in the constructor).
-
apply(model)¶
-
-
class
finn.transformation.general.GiveUniqueParameterTensors¶ Bases:
finn.transformation.base.TransformationMake every parameter tensor unique. The aim is to avoid affecting other nodes apart from the one the system is currently operating on.
-
apply(model)¶
-
-
class
finn.transformation.general.RemoveStaticGraphInputs¶ Bases:
finn.transformation.base.TransformationRemove any top-level graph inputs that have initializers.
-
apply(model)¶
-
-
class
finn.transformation.general.RemoveUnusedTensors¶ Bases:
finn.transformation.base.TransformationRemove any unused tensors in the graph by removing any initializers, ValueInfo and tensor annotations associated with it. Unused tensors do not appear as any input/output for any graph nodes.
-
apply(model)¶
-
-
class
finn.transformation.general.SortGraph¶ Bases:
finn.transformation.base.TransformationReturns the model with its node list sorted topologically. Any ONNX graph to be executed must have a topologically sorted node list, as dictated by the ONNX standard.
-
apply(model)¶
-