From 40dccd362b7dc62ceb2dc22bb0d49574bc41292e Mon Sep 17 00:00:00 2001 From: Meinrad Recheis Date: Thu, 11 Apr 2019 12:53:41 +0200 Subject: [PATCH] fixed the false-branch of the switch graph --- src/TensorFlowNET.Core/Operations/ControlFlows/CondContext.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/TensorFlowNET.Core/Operations/ControlFlows/CondContext.cs b/src/TensorFlowNET.Core/Operations/ControlFlows/CondContext.cs index 385caf1c..cedebb2a 100644 --- a/src/TensorFlowNET.Core/Operations/ControlFlows/CondContext.cs +++ b/src/TensorFlowNET.Core/Operations/ControlFlows/CondContext.cs @@ -207,6 +207,9 @@ namespace Tensorflow.Operations _values.Add(real_val.name); _external_values[real_val.name] = real_val; } + var (t0, t1) = control_flow_ops._SwitchRefOrTensor(real_val, _pred); + real_val = new[] {t0, t1}[_branch]; + _external_values[val.name] = real_val; } else {