Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private void CanRunInferenceOnAModel(GraphOptimizationLevel graphOptimizationLev
{
string modelPath = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet.onnx");

using (var cleanUp = new DisposableList<IDisposable>())
using (var cleanUp = new DisposableListTest<IDisposable>())
{
// Set the graph optimization level for this session.
SessionOptions options = new SessionOptions();
Expand Down Expand Up @@ -312,7 +312,7 @@ private void CanRunInferenceOnAModel(GraphOptimizationLevel graphOptimizationLev
Assert.Equal(typeof(float), inputMeta[inputName].ElementType);
Assert.True(inputMeta[inputName].IsTensor);
var longShape = Array.ConvertAll<int, long>(inputMeta[inputName].Dimensions, d => d);
var byteSize = ArrayUtilities.GetSizeForShape(longShape) * sizeof(float);
var byteSize = longShape.Aggregate(1L, (a, b) => a * b) * sizeof(float);
pinnedInputs.Add(FixedBufferOnnxValue.CreateFromMemory<float>(memInfo, inputData,
TensorElementType.Float, longShape, byteSize));

Expand All @@ -324,7 +324,7 @@ private void CanRunInferenceOnAModel(GraphOptimizationLevel graphOptimizationLev
Assert.Equal(typeof(float), outputMeta[outputName].ElementType);
Assert.True(outputMeta[outputName].IsTensor);
longShape = Array.ConvertAll<int, long>(outputMeta[outputName].Dimensions, d => d);
byteSize = ArrayUtilities.GetSizeForShape(longShape) * sizeof(float);
byteSize = longShape.Aggregate(1L, (a, b) => a * b) * sizeof(float);
float[] outputBuffer = new float[expectedOutput.Length];
pinnedOutputs.Add(FixedBufferOnnxValue.CreateFromMemory<float>(memInfo, outputBuffer,
TensorElementType.Float, longShape, byteSize));
Expand Down