neural_compressor.tensorflow.quantization.utils.graph_rewriter.generic.fuse_decomposed_bn
Fuse Decomposed BatchNorm Graph Rewriter.
Module Contents
Classes
Fuse decomposed small ops to BatchNormalization. |
Functions
|
Strips off ports and other decorations to get the underlying node name. |
|
Pulls a node def from a dictionary for a given name. |
|
Extracts the values from a const NodeDef as a numpy ndarray. |
|
Check if the inputs of the Reshape are valid. |
|
Get Reshape input nodes. |
|
Get the number of dimensions for a Const node. |
- class neural_compressor.tensorflow.quantization.utils.graph_rewriter.generic.fuse_decomposed_bn.FuseDecomposedBNOptimizer(input_graph_def)[source]
Fuse decomposed small ops to BatchNormalization.
- neural_compressor.tensorflow.quantization.utils.graph_rewriter.generic.fuse_decomposed_bn.node_name_from_input(node_name)[source]
Strips off ports and other decorations to get the underlying node name.
- neural_compressor.tensorflow.quantization.utils.graph_rewriter.generic.fuse_decomposed_bn.node_from_map(node_map, name)[source]
Pulls a node def from a dictionary for a given name.
- Parameters:
node_map – Dictionary containing an entry indexed by name for every node.
name – Identifies the node we want to find.
- Returns:
NodeDef of the node with the given name.
- Raises:
ValueError – If the node isn’t present in the dictionary.
- neural_compressor.tensorflow.quantization.utils.graph_rewriter.generic.fuse_decomposed_bn.values_from_const(node_def)[source]
Extracts the values from a const NodeDef as a numpy ndarray.
- Parameters:
node_def – Const NodeDef that has the values we want to access.
- Returns:
Numpy ndarray containing the values.
- Raises:
ValueError – If the node isn’t a Const.
- neural_compressor.tensorflow.quantization.utils.graph_rewriter.generic.fuse_decomposed_bn.valid_reshape_inputs(reshape_in0_ndef, reshape_in1_ndef)[source]
Check if the inputs of the Reshape are valid.