2017-04-14 59 views
1

在tensorflow,有用來重寫原始圖(ReWriteGraphForExecution)的函數:張量流中的目標節點和提取節點之間有什麼區別?

Status RewriteGraphForExecution(
    Graph* g, const gtl::ArraySlice<string>& fed_outputs, 
    const gtl::ArraySlice<string>& fetch_outputs, 
    const gtl::ArraySlice<string>& target_node_names, 
    const DeviceAttributes& device_info) { 

以上代碼從here 來我感到困惑的是fetch_outputs和target_node_names之間的準確差值。

非常感謝,任何信息將不勝感激!

回答

0

此圖表可能對您有所幫助。

enter image description here

這裏是頭聲明,

// Rewrite the graph structure of "*g" to deal with feeding node 
// outputs, fetching node outputs, and only running a subset of the 
// graph. "fed_outputs" and "fetch_outputs" are both lists of 
// output tensor identifiers in the form of 
// "<name>[:<optional_output_index>]", and "target_nodes_str" is a 
// lists of target node names in "*g" "g". 
// 
// In the resulting graph "*g", output edges in "fed_outputs" have 
// been redirected to special "_recv" nodes introduced into the graph. 
// If these fed nodes are not needed in order to compute the effects 
// of the nodes in "targets_nodes" and "fetch_outputs", then these may 
// be omitted from the graph. 
// 
// In the resulting graph "*g", additional "_send" nodes are connected 
// to every output in "fetch_outputs". These "_send" nodes are set up 
// to execute on the device described by device_info. 
// 
// On success, returns OK, and sets "*g" to a version of "*g" 
// that represents the portions of the graph necessary for producing 
// the output of all nodes listed in "target_node_names" and fetching the 
// specific node outputs specified in "fetch_outputs". 
// 
// On failure, returns the error status. Possible errors include: 
// - fed output "node:output_index" does not exist in "*g" 
// - fetch output "node:output_index" does not exist in "*g" 
// - target node "node" does not exist in "*g" 
Status RewriteGraphForExecution(
    Graph* g, const gtl::ArraySlice<string>& fed_outputs, 
    const gtl::ArraySlice<string>& fetch_outputs, 
    const gtl::ArraySlice<string>& target_node_names, 
const DeviceAttributes& device_info); 
+0

我已經看了圖,但它顯示的目標節點, 並從源代碼中的註釋是不容易的,我瞭解什麼是目標節點。 –

相關問題