tensorflow/tools/graph_transforms/remove_control_dependencies.cc
// Remove control dependencies in preparation for inference.
// In the tensorflow graph, control dependencies are represented as extra
// inputs which are referenced with "^tensor_name".
// See node_def.proto for more details.
Remove control dependencies in preparation for inference.
In the tensorflow graph, control dependencies are represented as extra
inputs which are referenced with "^tensor_name".
See node_def.proto for more details.
Remove control dependencies in preparation for inference . In the tensorflow graph control dependencies are represented as extra inputs which are referenced with " ^tensor_name " . See node_def . proto for more details .
Status RemoveControlDependencies(const GraphDef& input_graph_def,
                const TransformFuncContext& context,
                GraphDef* output_graph_def) {
    output_graph_def->Clear();
    for (const NodeDef& node : input_graph_def.node()) {
        NodeDef* new_node = output_graph_def->mutable_node()->Add();
        *new_node = node;
        new_node->clear_input();
        for (const auto& input : node.input()) {
            if (input[0] != '^') {
                new_node->add_input(input);
            }
        }
    }
    return Status::OK();
}
Status RemoveControlDependencies ( const GraphDef & input_graph_def , const TransformFuncContext & context , GraphDef * output_graph_def ) { output_graph_def -> Clear ( ) ; for ( const NodeDef & node : input_graph_def . node ( ) ) { NodeDef * new_node = output_graph_def -> mutable_node ( ) -> Add ( ) ; * new_node = node ; new_node -> clear_input ( ) ; for ( const auto & input : node . input ( ) ) { if ( input [ 0 ] != ' ' ) { new_node -> add_input ( input ) ; } } } return Status :: OK ( ) ; }
Remove control dependencies in preparation for inference.
Remove control dependencies in preparation for inference .