Skip to content

Commit 40dccd3

Browse files
committed
fixed the false-branch of the switch graph
1 parent 646f62e commit 40dccd3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/TensorFlowNET.Core/Operations/ControlFlows/CondContext.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ private Tensor _ProcessOutputTensor(Tensor val)
207207
_values.Add(real_val.name);
208208
_external_values[real_val.name] = real_val;
209209
}
210+
var (t0, t1) = control_flow_ops._SwitchRefOrTensor(real_val, _pred);
211+
real_val = new[] {t0, t1}[_branch];
212+
_external_values[val.name] = real_val;
210213
}
211214
else
212215
{

0 commit comments

Comments
 (0)