def convert_op_hints_to_stubs(session):
    'Converts a graphdef with LiteOp hints into stub operations.\n\n  This is used to prepare for toco conversion of complex intrinsic usages.\n\n  Args:\n    session: A TensorFlow session that contains the graph to convert.\n  Returns:\n    A new graphdef with all ops contained in OpHints being replaced by\n    a single op call with the right parameters.\n  '
    hints = _find_all_hints_in_graph_def(session)
    current_graph_def = session.graph_def
    for call in hints.values():
        input_names = ([None] * len(call.inputs))
        output_names = ([None] * len(call.outputs))
        output_dtypes = ([None] * len(call.outputs))
        output_quantized = False
        for (input_index, tensor) in call.inputs.items():
            input_names[input_index] = _tensor_name_base(tensor)
        for (output_index, tensor) in call.outputs.items():
            output_names[output_index] = _tensor_name_base(tensor)
            output_dtypes[output_index] = tensor.dtype.as_datatype_enum
        current_graph_def = _framework.fuse_op(current_graph_def, input_names, output_names, output_dtypes, output_quantized, call.uuid, call.function_name)
        for node in current_graph_def.node:
            if (node.name == call.uuid):
                for (param, tensor) in call.params.items():
                    node.attr[param].tensor.CopyFrom(tensor)
    return current_graph_def
Converts a graphdef with LiteOp hints into stub operations.

This is used to prepare for toco conversion of complex intrinsic usages.

Args:
  session: A TensorFlow session that contains the graph to convert.
Returns:
  A new graphdef with all ops contained in OpHints being replaced by
  a single op call with the right parameters.
def convert_op_hints_to_stubs(session):
    'Converts a graphdef with LiteOp hints into stub operations.\n\n  This is used to prepare for toco conversion of complex intrinsic usages.\n\n  Args:\n    session: A TensorFlow session that contains the graph to convert.\n  Returns:\n    A new graphdef with all ops contained in OpHints being replaced by\n    a single op call with the right parameters.\n  '
    hints = _find_all_hints_in_graph_def(session)
    current_graph_def = session.graph_def
    for call in hints.values():
        input_names = ([None] * len(call.inputs))
        output_names = ([None] * len(call.outputs))
        output_dtypes = ([None] * len(call.outputs))
        output_quantized = False
        for (input_index, tensor) in call.inputs.items():
            input_names[input_index] = _tensor_name_base(tensor)
        for (output_index, tensor) in call.outputs.items():
            output_names[output_index] = _tensor_name_base(tensor)
            output_dtypes[output_index] = tensor.dtype.as_datatype_enum
        current_graph_def = _framework.fuse_op(current_graph_def, input_names, output_names, output_dtypes, output_quantized, call.uuid, call.function_name)
        for node in current_graph_def.node:
            if (node.name == call.uuid):
                for (param, tensor) in call.params.items():
                    node.attr[param].tensor.CopyFrom(tensor)
    return current_graph_def