|
1 | | -using System; |
2 | | -using System.Collections.Generic; |
3 | | -using System.Text; |
4 | | -using Tensorflow.Operations; |
5 | | - |
6 | | -namespace Tensorflow |
7 | | -{ |
8 | | - public partial class Operation |
9 | | - { |
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Text; |
| 4 | +using Tensorflow.Operations; |
| 5 | + |
| 6 | +namespace Tensorflow |
| 7 | +{ |
| 8 | + public partial class Operation |
| 9 | + { |
10 | 10 | private ControlFlowContext _control_flow_context; |
11 | 11 |
|
12 | | - /// <summary> |
13 | | - /// Add this op to its control flow context. |
14 | | - /// |
15 | | - /// This may add new ops and change this op's inputs. self.inputs must be |
16 | | - /// available before calling this method. |
17 | | - /// </summary> |
18 | | - public void _control_flow_post_processing() |
19 | | - { |
20 | | - foreach(var input_tensor in inputs) |
21 | | - { |
22 | | - //TODO: implement below code dependency |
23 | | - //control_flow_util.CheckInputFromValidContext(this, input_tensor.op); |
24 | | - } |
25 | | - |
26 | | - if (_control_flow_context != null) |
27 | | - _control_flow_context.AddOp(this); |
28 | | - } |
29 | | - |
30 | | - public void _add_control_input(Operation op) |
31 | | - { |
32 | | - //c_api.TF_AddControlInput(_operDesc, op); |
33 | | - c_api.AddControlInput(graph, _handle, op); |
34 | | - } |
35 | | - |
36 | | - public void _add_control_inputs(Operation[] ops) |
37 | | - { |
38 | | - foreach (var op in ops) |
39 | | - _add_control_input(op); |
40 | | - } |
41 | | - |
42 | | - public void _set_control_flow_context(ControlFlowContext ctx) |
43 | | - { |
44 | | - _control_flow_context = ctx; |
45 | | - } |
46 | | - |
47 | | - public ControlFlowContext _get_control_flow_context() |
48 | | - { |
49 | | - return _control_flow_context; |
50 | | - } |
51 | | - } |
52 | | -} |
| 12 | + /// <summary> |
| 13 | + /// Add this op to its control flow context. |
| 14 | + /// |
| 15 | + /// This may add new ops and change this op's inputs. self.inputs must be |
| 16 | + /// available before calling this method. |
| 17 | + /// </summary> |
| 18 | + public void _control_flow_post_processing() |
| 19 | + { |
| 20 | + foreach(var input_tensor in inputs) |
| 21 | + { |
| 22 | + //TODO: implement below code dependency |
| 23 | + //control_flow_util.CheckInputFromValidContext(this, input_tensor.op); |
| 24 | + } |
| 25 | + |
| 26 | + if (_control_flow_context != null) |
| 27 | + _control_flow_context.AddOp(this); |
| 28 | + } |
| 29 | + |
| 30 | + public void _add_control_input(Operation op) |
| 31 | + { |
| 32 | + //c_api.TF_AddControlInput(_operDesc, op); |
| 33 | + c_api.AddControlInput(graph, _handle, op); |
| 34 | + } |
| 35 | + |
| 36 | + public void _add_control_inputs(Operation[] ops) |
| 37 | + { |
| 38 | + foreach (var op in ops) |
| 39 | + _add_control_input(op); |
| 40 | + } |
| 41 | + |
| 42 | + public void _set_control_flow_context(ControlFlowContext ctx) |
| 43 | + { |
| 44 | + _control_flow_context = ctx; |
| 45 | + } |
| 46 | + |
| 47 | + public ControlFlowContext _get_control_flow_context() |
| 48 | + { |
| 49 | + return _control_flow_context; |
| 50 | + } |
| 51 | + } |
| 52 | +} |
0 commit comments