|
|
@@ -6,6 +6,11 @@ namespace Tensorflow.Operations |
|
|
|
{ |
|
|
|
public abstract class ControlFlowContext : IPython, IControlFlowContext |
|
|
|
{ |
|
|
|
/// <summary> |
|
|
|
/// The predicate tensor in this branch |
|
|
|
/// </summary> |
|
|
|
protected Tensor _pivot; |
|
|
|
|
|
|
|
protected Stack<IControlFlowContext> _context_stack; |
|
|
|
public ControlFlowContext() |
|
|
|
{ |
|
|
@@ -28,6 +33,29 @@ namespace Tensorflow.Operations |
|
|
|
graph._set_control_flow_context(this); |
|
|
|
} |
|
|
|
|
|
|
|
public void AddOp(Operation op) |
|
|
|
{ |
|
|
|
_AddOpInternal(op); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual void _AddOpInternal(Operation op) |
|
|
|
{ |
|
|
|
if(op.inputs.Length == 0) |
|
|
|
{ |
|
|
|
_RemoveExternalControlEdges(op); |
|
|
|
op._add_control_input(_pivot.op); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual void _RemoveExternalControlEdges(Operation op) |
|
|
|
{ |
|
|
|
var internal_control_inputs = op.control_inputs; |
|
|
|
} |
|
|
|
|
|
|
|
public void Exit() |
|
|
|
{ |
|
|
|
var graph = ops.get_default_graph(); |
|
|
|