Browse Source

Fixed Node 57, but node 61 still error. #226

tags/v0.9
Oceania2018 6 years ago
parent
commit
6fc9add863
2 changed files with 14 additions and 7 deletions
  1. +8
    -3
      src/TensorFlowNET.Core/Operations/ControlFlows/CondContext.cs
  2. +6
    -4
      src/TensorFlowNET.Core/Operations/Operation.cs

+ 8
- 3
src/TensorFlowNET.Core/Operations/ControlFlows/CondContext.cs View File

@@ -73,9 +73,9 @@ namespace Tensorflow.Operations
// Use the real value if it comes from outer context. This is needed in
// particular for nested conds.
if (_external_values.ContainsKey(val.name))
result = _external_values[val.name];
else
result = val;
result = _external_values[val.name];
result = result == null ? val : result;
}
else
{
@@ -89,6 +89,11 @@ namespace Tensorflow.Operations
_external_values[result.name] = result;
}
// for debug purpose
if(ops.get_default_graph()._nodes_by_name.Count > 60)
{
}

with(ops.control_dependencies(null), ctrl =>
{
var (r0, r1) = control_flow_ops._SwitchRefOrTensor(result, _pred);


+ 6
- 4
src/TensorFlowNET.Core/Operations/Operation.cs View File

@@ -279,11 +279,13 @@ namespace Tensorflow
/// <param name="tensor"> the Tensor to be used as the input at the given index.</param>
public void _update_input(int index, Tensor tensor)
{
_assert_same_graph(tensor);

var input = _tf_input(index);
var output = tensor._as_tf_output();
_assert_same_graph( tensor);
// Reset cached inputs.
_inputs=new InputList(new Tensor[]{ tensor }); // is this right? original code: self._inputs_val=None
var output = tensor._as_tf_output();
// Reset cached inputs.
_inputs = null;// new InputList(new Tensor[] { tensor }); // is this right? original code: self._inputs_val=None
// TODO: implement below code dependencies
//c_api.UpdateEdge(_graph._c_graph, output, input);
}


Loading…
Cancel
Save