diff --git a/src/TensorFlowNET.Core/Operations/Operation.Output.cs b/src/TensorFlowNET.Core/Operations/Operation.Output.cs index 5b0b43b3..d7e975bb 100644 --- a/src/TensorFlowNET.Core/Operations/Operation.Output.cs +++ b/src/TensorFlowNET.Core/Operations/Operation.Output.cs @@ -42,8 +42,8 @@ namespace Tensorflow if (NumControlOutputs > 0) { IntPtr control_output_handle = Marshal.AllocHGlobal(Marshal.SizeOf() * NumControlOutputs); - c_api.TF_OperationGetControlOutputs(_handle, control_output_handle, NumControlInputs); - for (int i = 0; i < NumControlInputs; i++) + c_api.TF_OperationGetControlOutputs(_handle, control_output_handle, NumControlOutputs); + for (int i = 0; i < NumControlOutputs; i++) { var handle = control_output_handle + Marshal.SizeOf() * i; control_outputs[i] = new Operation(*(IntPtr*)handle);