Skip to content

Commit 98b7fcd

Browse files
committed
docs(neuralnetworks): convert hotfix rationale to code comments
CodeRabbit nitpicks (PRRT_kwDOKSXUF858Ek3i UNet3D, PRRT_kwDOKSXUF858Ek3m VGG, same pattern across the other 9): the XML <summary> blocks I added next to each Predict override duplicated the existing public API doc and leaked compiled-replay / tracer internals into IntelliSense / published docs. Converted all 11 to plain `// Hotfix:` comments so only one user-facing XML summary remains per method, and pointed the revert-me note at the upstream root-cause issue (ooples/AiDotNet.Tensors#228). Files: ResNetNetwork, VGGNetwork, MobileNetV2Network, EfficientNetNetwork, ConvolutionalNeuralNetwork, FastText, GloVe, Word2Vec, SiameseNeuralNetwork, UNet3D, VoxelCNN. Build: 0 errors.
1 parent 257c5fc commit 98b7fcd

11 files changed

Lines changed: 65 additions & 81 deletions

src/NeuralNetworks/ConvolutionalNeuralNetwork.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,11 @@ public override void UpdateParameters(Vector<T> parameters)
234234
/// about what's in the image.
235235
/// </para>
236236
/// </remarks>
237-
/// <summary>
238-
/// Runs <see cref="Forward"/> directly rather than routing through the
239-
/// compiled-replay path. <see cref="Forward"/> contains shape-conditional
240-
/// control flow that the tracer does not capture faithfully — routing
241-
/// through <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed
242-
/// to return an intermediate feature-map shape instead of the final logits.
243-
/// </summary>
237+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict.
238+
// Forward has shape-conditional control flow the tracer does not capture
239+
// correctly — routing through PredictCompiled returned an intermediate
240+
// feature-map shape instead of the final logits. Tracked upstream at
241+
// ooples/AiDotNet.Tensors#228; remove this override once that lands.
244242
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
245243

246244
/// <summary>

src/NeuralNetworks/EfficientNetNetwork.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,11 @@ public Tensor<T> Forward(Tensor<T> input)
293293
}
294294

295295
/// <inheritdoc />
296-
/// <summary>
297-
/// Runs <see cref="Forward"/> directly rather than routing through the
298-
/// compiled-replay path. <see cref="Forward"/> contains shape-conditional
299-
/// control flow that the tracer does not capture faithfully — routing
300-
/// through <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed
301-
/// to return an intermediate feature-map shape instead of the final logits.
302-
/// </summary>
296+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict.
297+
// Forward has shape-conditional control flow the tracer does not capture
298+
// correctly — routing through PredictCompiled returned an intermediate
299+
// feature-map shape instead of the final logits. Tracked upstream at
300+
// ooples/AiDotNet.Tensors#228; remove this override once that lands.
303301
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
304302

305303
/// <inheritdoc />

src/NeuralNetworks/FastText.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,12 @@ public override void UpdateParameters(Vector<T> parameters)
244244
}
245245
}
246246

247-
/// <summary>
248-
/// Runs <see cref="Forward"/> directly rather than routing through the
249-
/// compiled-replay path. <see cref="Forward"/> contains shape-conditional
250-
/// control flow that the tracer does not capture faithfully — routing
251-
/// through <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed
252-
/// to return an intermediate feature-map shape instead of the final output.
253-
/// </summary>
247+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict.
248+
// Forward has shape-conditional control flow the tracer does not
249+
// capture correctly — routing through PredictCompiled returned an
250+
// intermediate shape instead of the final output. Tracked upstream
251+
// at ooples/AiDotNet.Tensors#228; remove this override once that
252+
// lands.
254253
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
255254

256255
/// <summary>

src/NeuralNetworks/GloVe.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,12 @@ public override void UpdateParameters(Vector<T> parameters)
293293
/// <b>For Beginners:</b> This is identical to the Forward pass—it takes word IDs and
294294
/// returns their addresses (embeddings).
295295
/// </remarks>
296-
/// <summary>
297-
/// Runs <see cref="Forward"/> directly rather than routing through the
298-
/// compiled-replay path. <see cref="Forward"/> contains shape-conditional
299-
/// control flow that the tracer does not capture faithfully — routing
300-
/// through <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed
301-
/// to return an intermediate shape instead of the final output.
302-
/// </summary>
296+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict.
297+
// Forward has shape-conditional control flow the tracer does not
298+
// capture correctly — routing through PredictCompiled returned an
299+
// intermediate shape instead of the final embedding output. Tracked
300+
// upstream at ooples/AiDotNet.Tensors#228; remove this override once
301+
// that lands.
303302
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
304303

305304
/// <summary>

src/NeuralNetworks/MobileNetV2Network.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,12 @@ public override Dictionary<string, Tensor<T>> GetNamedLayerActivations(Tensor<T>
288288
}
289289

290290
/// <inheritdoc />
291-
/// <summary>
292-
/// Runs <see cref="Forward"/> directly rather than routing through the
293-
/// compiled-replay path. <see cref="Forward"/> contains shape-conditional
294-
/// control flow that the tracer does not capture faithfully — routing
295-
/// through <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed
296-
/// to return an intermediate feature-map shape instead of the final logits.
297-
/// </summary>
291+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict.
292+
// Forward has shape-conditional control flow (3D → 4D promotion +
293+
// trailing squeeze) that the tracer does not capture correctly — routing
294+
// through PredictCompiled returned an intermediate feature-map shape
295+
// instead of the final logits. Tracked upstream at
296+
// ooples/AiDotNet.Tensors#228; remove this override once that lands.
298297
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
299298

300299
/// <inheritdoc />

src/NeuralNetworks/ResNetNetwork.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -493,17 +493,17 @@ public override void UpdateParameters(Vector<T> parameters)
493493
}
494494

495495
/// <summary>
496-
/// Makes a prediction using the ResNet network for the given input. Runs
497-
/// <see cref="Forward"/> directly rather than routing through the
498-
/// compiled-replay path, because <see cref="Forward"/> contains
499-
/// shape-conditional control flow (rank-3 → rank-4 batch promotion and the
500-
/// final <c>Reshape</c> that strips the synthetic batch dim) that the
501-
/// tracer does not capture faithfully — routing through
502-
/// <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed to
503-
/// return an intermediate feature-map shape instead of the final logits.
496+
/// Makes a prediction using the ResNet network for the given input.
504497
/// </summary>
505498
/// <param name="input">The input tensor to make a prediction for.</param>
506499
/// <returns>The predicted output tensor containing class probabilities.</returns>
500+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict.
501+
// Forward has shape-conditional control flow (rank-3 → rank-4 batch
502+
// promotion and the trailing Reshape that strips the synthetic batch
503+
// dim) that the tracer does not capture correctly — routing through
504+
// PredictCompiled returned an intermediate feature-map shape instead of
505+
// the final logits. Tracked upstream at ooples/AiDotNet.Tensors#228;
506+
// remove this override once that lands.
507507
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
508508

509509
/// <summary>

src/NeuralNetworks/SiameseNeuralNetwork.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,12 @@ public override void UpdateParameters(Vector<T> parameters)
301301
}
302302
}
303303

304-
/// <summary>
305-
/// Runs <see cref="Forward"/> directly rather than routing through the
306-
/// compiled-replay path. <see cref="Forward"/> contains shape-conditional
307-
/// control flow that the tracer does not capture faithfully — routing
308-
/// through <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed
309-
/// to return an intermediate shape instead of the final output.
310-
/// </summary>
304+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict.
305+
// Forward has shape-conditional control flow the tracer does not
306+
// capture correctly — routing through PredictCompiled returned an
307+
// intermediate shape instead of the final output. Tracked upstream
308+
// at ooples/AiDotNet.Tensors#228; remove this override once that
309+
// lands.
311310
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
312311

313312
/// <summary>

src/NeuralNetworks/UNet3D.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,12 @@ public Tensor<T> Forward(Tensor<T> input)
235235
/// </summary>
236236
/// <param name="input">The input voxel grid tensor.</param>
237237
/// <returns>The predicted segmentation map.</returns>
238-
/// <inheritdoc />
239-
/// <summary>
240-
/// Runs <see cref="Forward"/> directly rather than routing through the
241-
/// compiled-replay path. <see cref="Forward"/> contains shape-conditional
242-
/// control flow that the tracer does not capture faithfully — routing
243-
/// through <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed
244-
/// to return an intermediate feature-map shape instead of the final output.
245-
/// </summary>
238+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict.
239+
// Forward has shape-conditional control flow the tracer does not capture
240+
// correctly — routing through PredictCompiled returned an intermediate
241+
// feature-map shape instead of the final segmentation map. Tracked
242+
// upstream at ooples/AiDotNet.Tensors#228; remove this override once
243+
// that lands.
246244
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
247245

248246
/// <summary>

src/NeuralNetworks/VGGNetwork.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,12 @@ public override void UpdateParameters(Vector<T> parameters)
339339
/// probability is the network's prediction.
340340
/// </para>
341341
/// </remarks>
342-
/// <summary>
343-
/// Runs <see cref="Forward"/> directly rather than routing through the
344-
/// compiled-replay path. <see cref="Forward"/> contains shape-conditional
345-
/// control flow (batch-dim promotion, post-pipeline reshape) that the
346-
/// tracer does not capture faithfully — routing through
347-
/// <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed to
348-
/// return an intermediate feature-map shape instead of the final logits.
349-
/// </summary>
342+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict
343+
// because Forward has shape-conditional control flow (batch-dim
344+
// promotion, post-pipeline reshape) that the tracer does not capture
345+
// correctly — routing through PredictCompiled returned an intermediate
346+
// feature-map shape instead of the final logits. Tracked upstream at
347+
// ooples/AiDotNet.Tensors#228; remove this override once that lands.
350348
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
351349

352350
/// <summary>

src/NeuralNetworks/VoxelCNN.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,11 @@ public Tensor<T> Forward(Tensor<T> input)
228228
/// </summary>
229229
/// <param name="input">The input voxel grid tensor.</param>
230230
/// <returns>The predicted class probabilities or scores.</returns>
231-
/// <inheritdoc />
232-
/// <summary>
233-
/// Runs <see cref="Forward"/> directly rather than routing through the
234-
/// compiled-replay path. <see cref="Forward"/> contains shape-conditional
235-
/// control flow that the tracer does not capture faithfully — routing
236-
/// through <see cref="NeuralNetworkBase{T}.PredictCompiled"/> was observed
237-
/// to return an intermediate feature-map shape instead of the final output.
238-
/// </summary>
231+
// Hotfix: bypass the compiled-replay path in NeuralNetworkBase.Predict.
232+
// Forward has shape-conditional control flow the tracer does not capture
233+
// correctly — routing through PredictCompiled returned an intermediate
234+
// feature-map shape instead of the final logits. Tracked upstream at
235+
// ooples/AiDotNet.Tensors#228; remove this override once that lands.
239236
public override Tensor<T> Predict(Tensor<T> input) => Forward(input);
240237

241238
/// <summary>

0 commit comments

Comments
 (0)