@@ -16,6 +16,7 @@ public partial class Operation : ITensorOrOperation
1616 private int _id_value ;
1717
1818 public string type => OpType ;
19+ public Operation op => this ;
1920
2021 private Status status = new Status ( ) ;
2122
@@ -75,7 +76,7 @@ public Operation(Graph g, string opType, string oper_name)
7576 /// </param>
7677 /// <param name="original_op"></param>
7778 /// <param name="op_def"></param>
78- public Operation ( NodeDef node_def , Graph g , Tensor [ ] inputs = null , TF_DataType [ ] output_types = null , Operation [ ] control_inputs = null , TF_DataType [ ] input_types = null , string original_op = "" , OpDef op_def = null )
79+ public Operation ( NodeDef node_def , Graph g , Tensor [ ] inputs = null , TF_DataType [ ] output_types = null , ITensorOrOperation [ ] control_inputs = null , TF_DataType [ ] input_types = null , string original_op = "" , OpDef op_def = null )
7980 {
8081 Graph = g ;
8182
@@ -120,6 +121,11 @@ public Operation(NodeDef node_def, Graph g, Tensor[] inputs = null, TF_DataType[
120121 _control_flow_post_processing ( ) ;
121122 }
122123
124+ public void run ( FeedItem [ ] feed_dict = null , Session session = null )
125+ {
126+ ops . _run_using_default_session ( this , feed_dict , Graph , session ) ;
127+ }
128+
123129 private object [ ] _reconstruct_sequence_inputs ( OpDef op_def , Tensor [ ] inputs , MapField < string , AttrValue > attrs )
124130 {
125131 var grouped_inputs = new List < object > ( ) ;
@@ -204,7 +210,7 @@ private NodeDef GetNodeDef()
204210
205211 public override string ToString ( )
206212 {
207- return _handle == IntPtr . Zero ? "Undefined" : $ "'{ Name } ' type={ OpType } ";
213+ return _handle == IntPtr . Zero ? "tf.Operation Undefined" : $ "tf.Operation '{ Name } ' type={ OpType } ";
208214 }
209215
210216 public static implicit operator Operation ( IntPtr handle ) => new Operation ( handle ) ;
0 commit comments