Frage: Wie der Titel seed, ich wandern Wann sollten wir die Config place_pruned_graph in GraphOptions verwenden. Was ist der Zweck dieser Konfiguration?Wann sollten wir die Konfiguration "place_pruned_graph" verwenden?
Ich bin auf den Kommentar zu dieser Konfiguration nicht klar:
// Only place the subgraphs that are run, rather than the entire graph.
//
// This is useful for interactive graph building, where one might
// produce graphs that cannot be placed during the debugging
// process. In particular, it allows the client to continue work in
// a session after adding a node to a graph whose placement
// constraints are unsatisfiable.
Wir wissen, dass Tensorflow eine gesamte Grafik in mehrere Teilgraphen in normalen partitionieren. Und the following code von CreateGraphs von direct_session.cc nimmt den Else-Zweig in normal. (Soweit ich sehen kann, fand ich nie den Fall die if-Zweig (so dass ich nicht weiß, wann sollten wir es auslösen).
if (options_.config.graph_options().place_pruned_graph()) {
// Because we are placing pruned graphs, we need to create a
// new SimpleGraphExecutionState for every new unseen graph,
// and then place it.
SimpleGraphExecutionStateOptions prune_options;
prune_options.device_set = &device_set_;
prune_options.session_options = &options_;
prune_options.stateful_placements = stateful_placements_;
TF_RETURN_IF_ERROR(SimpleGraphExecutionState::MakeForPrunedGraph(
execution_state_->original_graph_def().library(), prune_options,
execution_state_->original_graph_def(), subgraph_options,
&temp_exec_state_holder, &client_graph));
execution_state = temp_exec_state_holder.get();
} else {
execution_state = execution_state_.get();
TF_RETURN_IF_ERROR(
execution_state->BuildGraph(subgraph_options, &client_graph));
}