File tree Expand file tree Collapse file tree
src/TensorFlowNET.Core/Graphs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,19 +54,21 @@ public Operation[] ReturnOperations(IntPtr results)
5454 var handle = return_oper_handle . node + tf_op_size * i ;
5555 return_opers [ i ] = new Operation ( * ( IntPtr * ) handle ) ;
5656 }
57- }
58-
57+ }
58+
5959 return return_opers;
6060 }
6161
6262 public Operation OperationByName( string operName )
6363 {
6464 var handle = c_api. TF_GraphOperationByName ( _handle , operName ) ;
65- if ( graph_key != tf . get_default_graph ( ) . graph_key )
66- {
67- Console. WriteLine ( $ "Current graph is not default graph.") ;
68- // throw new ValueError($"Current graph is not default graph.");
65+ var defaultKey = tf. get_default_graph ( ) . graph_key ;
66+ if ( graph_key != defaultKey )
67+ {
68+ //Console.WriteLine($"Current graph is not default graph.");
69+ throw new ValueError ( $ "Current graph is not default graph. Default Graph Key: { defaultKey } , Current Graph Key: { graph_key } ") ;
6970 }
71+
7072 return new Operation ( handle , g : this ) ;
7173 }
7274
You can’t perform that action at this time.
0 commit comments