@@ -73,9 +73,9 @@ namespace Tensorflow.Operations | |||||
// Use the real value if it comes from outer context. This is needed in | // Use the real value if it comes from outer context. This is needed in | ||||
// particular for nested conds. | // particular for nested conds. | ||||
if (_external_values.ContainsKey(val.name)) | 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 | else | ||||
{ | { | ||||
@@ -89,6 +89,11 @@ namespace Tensorflow.Operations | |||||
_external_values[result.name] = result; | _external_values[result.name] = result; | ||||
} | } | ||||
// for debug purpose | |||||
if(ops.get_default_graph()._nodes_by_name.Count > 60) | |||||
{ | |||||
} | |||||
with(ops.control_dependencies(null), ctrl => | with(ops.control_dependencies(null), ctrl => | ||||
{ | { | ||||
var (r0, r1) = control_flow_ops._SwitchRefOrTensor(result, _pred); | var (r0, r1) = control_flow_ops._SwitchRefOrTensor(result, _pred); | ||||
@@ -279,11 +279,13 @@ namespace Tensorflow | |||||
/// <param name="tensor"> the Tensor to be used as the input at the given index.</param> | /// <param name="tensor"> the Tensor to be used as the input at the given index.</param> | ||||
public void _update_input(int index, Tensor tensor) | public void _update_input(int index, Tensor tensor) | ||||
{ | { | ||||
_assert_same_graph(tensor); | |||||
var input = _tf_input(index); | 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 | // TODO: implement below code dependencies | ||||
//c_api.UpdateEdge(_graph._c_graph, output, input); | //c_api.UpdateEdge(_graph._c_graph, output, input); | ||||
} | } | ||||