(self, original_node)
Replaces a Reshape node with the eight bit equivalent sub-graph.

    Args:
      original_node: Float node to be converted.

    Returns:
      Subgraph representing the quantized version of the original node.
Replaces a Reshape node with the eight bit equivalent sub-graph.
Replaces a Reshape node with the eight bit equivalent sub - graph .
def eightbitize_reshape_node(self, original_node):
    """Replaces a Reshape node with the eight bit equivalent sub-graph.

    Args:
      original_node: Float node to be converted.

    Returns:
      Subgraph representing the quantized version of the original node.

    """
    namespace_prefix = original_node.name + "_eightbit"
    quantized_reshape_name = namespace_prefix + "_quantized_reshape"
    reshape_dims_name, reduction_dims_name = self.add_common_quantization_nodes(
        namespace_prefix)
    shape_input_name = original_node.input[1]
    quantize_input_name, min_input_name, max_input_name = (
        self.eightbitize_input_to_node(namespace_prefix, original_node.input[0],
                                       reshape_dims_name, reduction_dims_name))
    quantized_reshape_node = create_node(
        "QuantizedReshape", quantized_reshape_name,
        [quantize_input_name, shape_input_name, min_input_name, max_input_name])
    set_attr_dtype(quantized_reshape_node, "T", dtypes.quint8)
    self.add_output_graph_node(quantized_reshape_node)
    self.add_dequantize_result_node(quantized_reshape_name, original_node.name)
def eightbitize_reshape_node ( self , original_node ) : namespace_prefix = original_node . name + "_eightbit" quantized_reshape_name = namespace_prefix + "_quantized_reshape" reshape_dims_name , reduction_dims_name = self . add_common_quantization_nodes ( namespace_prefix ) shape_input_name = original_node . input [ 1 ] quantize_input_name , min_input_name , max_input_name = ( self . eightbitize_input_to_node ( namespace_prefix , original_node . input [ 0 ] , reshape_dims_name , reduction_dims_name ) ) quantized_reshape_node = create_node ( "QuantizedReshape" , quantized_reshape_name , [ quantize_input_name , shape_input_name , min_input_name , max_input_name ] ) set_attr_dtype ( quantized_reshape_node , "T" , dtypes . quint8 ) self . add_output_graph_node ( quantized_reshape_node ) self . add_dequantize_result_node ( quantized_reshape_name , original_node . name )