diff --git a/src/TensorFlowNET.Core/Operations/Operation.cs b/src/TensorFlowNET.Core/Operations/Operation.cs index 9f4280d9..e1bf9246 100644 --- a/src/TensorFlowNET.Core/Operations/Operation.cs +++ b/src/TensorFlowNET.Core/Operations/Operation.cs @@ -285,9 +285,12 @@ namespace Tensorflow 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); + _inputs = null; + // after the c_api call next time _inputs is accessed + // the updated inputs are reloaded from the c_api + c_api.TF_UpdateEdge(_graph, output, input, status); + //var updated_inputs = inputs; + } private void _assert_same_graph(Tensor tensor) diff --git a/test/TensorFlowNET.UnitTest/control_flow_ops_test/CondTestCases.cs b/test/TensorFlowNET.UnitTest/control_flow_ops_test/CondTestCases.cs index ef39d41e..338d0388 100644 --- a/test/TensorFlowNET.UnitTest/control_flow_ops_test/CondTestCases.cs +++ b/test/TensorFlowNET.UnitTest/control_flow_ops_test/CondTestCases.cs @@ -19,12 +19,12 @@ namespace TensorFlowNET.UnitTest.control_flow_ops_test var y = tf.constant(5); var z = control_flow_ops.cond(tf.less(x, y), () => tf.multiply(x, tf.constant(17)), () => tf.add(y, tf.constant(23))); - //tf.train.export_meta_graph(@"D:\dev\tensorboard\logdir\sharp.meta", as_text: false); + tf.train.export_meta_graph(@"D:\dev\tensorboard\logdir\sharp.meta", as_text: false); self.assertEquals(eval_scalar(z), 34); }); } - [Ignore("This Test Fails due to missing edges in the graph!")] + //[Ignore("This Test Fails due to missing edges in the graph!")] [TestMethod] public void testCondFalse() {