Skip to content

Commit d7eb0a6

Browse files
authored
Fix loading type problem for netfx (#2409)
* fix netfx tests * optimise the declaration * using typeof and removing unnecessary environment
1 parent 617f7f6 commit d7eb0a6

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

test/Microsoft.ML.OnnxTransformTest/OnnxTransformTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ public void OnnxStatic()
245245
[OnnxFact]
246246
void TestCommandLine()
247247
{
248-
var env = new MLContext();
249248
var x = Maml.Main(new[] { @"showschema loader=Text{col=data_0:R4:0-150527} xf=Onnx{InputColumns={data_0} OutputColumns={softmaxout_1} model={squeezenet/00000001/model.onnx}}" });
250249
Assert.Equal(0, x);
251250
}

test/Microsoft.ML.Tests/TensorFlowEstimatorTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ void TestOldSavingAndLoading()
135135
[ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline
136136
void TestCommandLine()
137137
{
138-
var env = new MLContext();
138+
// typeof helps to load the TensorFlowTransformer type.
139+
Type type = typeof(TensorFlowTransformer);
139140
Assert.Equal(Maml.Main(new[] { @"showschema loader=Text{col=a:R4:0-3 col=b:R4:0-3} xf=TFTransform{inputs=a inputs=b outputs=c modellocation={model_matmul/frozen_saved_model.pb}}" }), (int)0);
140141
}
141142

test/Microsoft.ML.Tests/TermEstimatorTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ void TestMetadataCopy()
154154
[Fact]
155155
void TestCommandLine()
156156
{
157-
var env = new MLContext();
158157
Assert.Equal(0, Maml.Main(new[] { @"showschema loader=Text{col=A:R4:0} xf=Term{col=B:A} in=f:\2.txt" }));
159158
}
160159

test/Microsoft.ML.Tests/Transformers/CopyColumnEstimatorTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ void TestMetadataCopy()
153153
[Fact]
154154
void TestCommandLine()
155155
{
156-
var env = new MLContext();
157156
Assert.Equal(Maml.Main(new[] { @"showschema loader=Text{col=A:R4:0} xf=copy{col=B:A} in=f:\1.txt" }), (int)0);
158157
}
159158

test/Microsoft.ML.Tests/Transformers/NormalizerTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
using System;
56
using System.Collections.Immutable;
67
using System.IO;
78
using Microsoft.Data.DataView;
@@ -325,9 +326,11 @@ public void WhiteningWorkout()
325326
Done();
326327
}
327328

328-
[ConditionalFact(typeof(BaseTestBaseline), nameof(BaseTestBaseline.NotFullFramework))] // Tracked by https://github.com/dotnet/machinelearning/issues/2104
329+
[Fact]
329330
public void TestWhiteningCommandLine()
330331
{
332+
// typeof helps to load the VectorWhiteningTransformer type.
333+
Type type = typeof(VectorWhiteningTransformer);
331334
Assert.Equal(Maml.Main(new[] { @"showschema loader=Text{col=A:R4:0-10} xf=whitening{col=B:A} in=f:\2.txt" }), (int)0);
332335
}
333336

0 commit comments

Comments
 (0)