(self, original_node)
Replaces a BiasAdd node with the eight bit equivalent sub-graph.
Replaces a BiasAdd node with the eight bit equivalent sub-graph.
Replaces a BiasAdd node with the eight bit equivalent sub - graph .
def eightbitize_bias_add_node(self, original_node):
    """Replaces a BiasAdd node with the eight bit equivalent sub-graph."""
    quantized_bias_add_name = (
        original_node.name + "_eightbit_quantized_bias_add")
    all_input_names = self.add_eightbit_prologue_nodes(original_node)
    quantized_bias_add_node = create_node("QuantizedBiasAdd",
                                          quantized_bias_add_name,
                                          all_input_names)
    set_attr_dtype(quantized_bias_add_node, "T1", dtypes.quint8)
    set_attr_dtype(quantized_bias_add_node, "T2", dtypes.quint8)
    set_attr_dtype(quantized_bias_add_node, "out_type", dtypes.qint32)
    self.add_output_graph_node(quantized_bias_add_node)
    quantize_down_name = self.add_quantize_down_nodes(original_node,
                                                      quantized_bias_add_name)
    self.add_dequantize_result_node(quantize_down_name, original_node.name)
def eightbitize_bias_add_node ( self , original_node ) : quantized_bias_add_name = ( original_node . name + "_eightbit_quantized_bias_add" ) all_input_names = self . add_eightbit_prologue_nodes ( original_node ) quantized_bias_add_node = create_node ( "QuantizedBiasAdd" , quantized_bias_add_name , all_input_names ) set_attr_dtype ( quantized_bias_add_node , "T1" , dtypes . quint8 ) set_attr_dtype ( quantized_bias_add_node , "T2" , dtypes . quint8 ) set_attr_dtype ( quantized_bias_add_node , "out_type" , dtypes . qint32 ) self . add_output_graph_node ( quantized_bias_add_node ) quantize_down_name = self . add_quantize_down_nodes ( original_node , quantized_bias_add_name ) self . add_dequantize_result_node ( quantize_down_name , original_node . name )