diff --git a/Directory.Build.props b/Directory.Build.props index f3c968c48b..22492ad639 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,13 +8,15 @@ Debug Debug;Release;Debug-Intrinsics;Release-Intrinsics AnyCPU - x64 + x64 + $(TargetArchitecture) $(Platform).$(Configuration) https://api.nuget.org/v3/index.json; + https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json; https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; diff --git a/pkg/Microsoft.ML/build/netstandard2.0/Microsoft.ML.targets b/pkg/Microsoft.ML/build/netstandard2.0/Microsoft.ML.targets index b889bdd1ec..df03944a1c 100644 --- a/pkg/Microsoft.ML/build/netstandard2.0/Microsoft.ML.targets +++ b/pkg/Microsoft.ML/build/netstandard2.0/Microsoft.ML.targets @@ -13,10 +13,10 @@ the PlatformTarget is empty, and you don't know until runtime (i.e. which dotnet.exe) what processor architecture will be used. --> - + Text="Microsoft.ML currently supports 'x64' and 'x86' processor architectures. Please ensure your application is targeting 'x64' or 'x86'." /> \ No newline at end of file diff --git a/pkg/common/CommonPackage.props b/pkg/common/CommonPackage.props index fa15d15eb5..542439430c 100644 --- a/pkg/common/CommonPackage.props +++ b/pkg/common/CommonPackage.props @@ -12,6 +12,11 @@ PreserveNewest false + + PreserveNewest + false + \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 6c6117e7dd..1ebabb9213 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -12,8 +12,6 @@ $(WarningsNotAsErrors);1591 $(MSBuildThisFileDirectory)\Source.ruleset - - x64 $(BaseOutputPath)$(TargetArchitecture).$(Configuration)\Native diff --git a/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj b/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj index 920232ef29..44aa3ec001 100644 --- a/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj +++ b/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj @@ -11,7 +11,8 @@ - + + diff --git a/src/Native/Stdafx.h b/src/Native/Stdafx.h index 3bbb026efa..4008ebd012 100644 --- a/src/Native/Stdafx.h +++ b/src/Native/Stdafx.h @@ -14,7 +14,7 @@ #ifdef _WIN32 #include -#define EXPORT_API(ret) extern "C" __declspec(dllexport) ret __stdcall +#define EXPORT_API(ret) extern "C" __declspec(dllexport) ret #else #include "UnixSal.h" diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 8489cb8f87..d4aac4efd3 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -27,8 +27,9 @@ - - + + + \ No newline at end of file diff --git a/test/Microsoft.ML.Core.Tests/Microsoft.ML.Core.Tests.csproj b/test/Microsoft.ML.Core.Tests/Microsoft.ML.Core.Tests.csproj index 13673ae245..5ec2eb7a03 100644 --- a/test/Microsoft.ML.Core.Tests/Microsoft.ML.Core.Tests.csproj +++ b/test/Microsoft.ML.Core.Tests/Microsoft.ML.Core.Tests.csproj @@ -30,6 +30,10 @@ + + + + diff --git a/test/Microsoft.ML.Core.Tests/UnitTests/TestCSharpApi.cs b/test/Microsoft.ML.Core.Tests/UnitTests/TestCSharpApi.cs index 7ed7ddd8dd..7fa731ec22 100644 --- a/test/Microsoft.ML.Core.Tests/UnitTests/TestCSharpApi.cs +++ b/test/Microsoft.ML.Core.Tests/UnitTests/TestCSharpApi.cs @@ -959,7 +959,7 @@ public void TestOvaMacroWithUncalibratedLearner() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TestTensorFlowEntryPoint() { var dataPath = GetDataPath("Train-Tiny-28x28.txt"); diff --git a/test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs b/test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs index 94c2e2e67a..fa342d1798 100644 --- a/test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs +++ b/test/Microsoft.ML.Core.Tests/UnitTests/TestEntryPoints.cs @@ -1787,14 +1787,14 @@ public void EntryPointEvaluateRanking() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only public void EntryPointLightGbmBinary() { Env.ComponentCatalog.RegisterAssembly(typeof(LightGbmBinaryPredictor).Assembly); TestEntryPointRoutine("breast-cancer.txt", "Trainers.LightGbmBinaryClassifier"); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only public void EntryPointLightGbmMultiClass() { Env.ComponentCatalog.RegisterAssembly(typeof(LightGbmBinaryPredictor).Assembly); @@ -3710,7 +3710,7 @@ public void EntryPointWordEmbeddings() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void EntryPointTensorFlowTransform() { Env.ComponentCatalog.RegisterAssembly(typeof(TensorFlowTransform).Assembly); diff --git a/test/Microsoft.ML.FSharp.Tests/Microsoft.ML.FSharp.Tests.fsproj b/test/Microsoft.ML.FSharp.Tests/Microsoft.ML.FSharp.Tests.fsproj index 4d5de1b568..92b35bd65a 100644 --- a/test/Microsoft.ML.FSharp.Tests/Microsoft.ML.FSharp.Tests.fsproj +++ b/test/Microsoft.ML.FSharp.Tests/Microsoft.ML.FSharp.Tests.fsproj @@ -8,7 +8,7 @@ 2003;$(NoWarn) false - x64 + $(TargetArchitecture) diff --git a/test/Microsoft.ML.OnnxTransformTest/OnnxTransformTests.cs b/test/Microsoft.ML.OnnxTransformTest/OnnxTransformTests.cs index 9eccd628ad..c1994057b5 100644 --- a/test/Microsoft.ML.OnnxTransformTest/OnnxTransformTests.cs +++ b/test/Microsoft.ML.OnnxTransformTest/OnnxTransformTests.cs @@ -57,7 +57,7 @@ public OnnxTransformTests(ITestOutputHelper output) : base(output) { } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 fails with "An attempt was made to load a program with an incorrect format." void TestSimpleCase() { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -100,7 +100,7 @@ void TestSimpleCase() catch (InvalidOperationException) { } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 fails with "An attempt was made to load a program with an incorrect format." void TestOldSavingAndLoading() { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -158,7 +158,7 @@ void TestOldSavingAndLoading() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 fails with "An attempt was made to load a program with an incorrect format." public void OnnxStatic() { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -205,7 +205,7 @@ public void OnnxStatic() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline void TestCommandLine() { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) diff --git a/test/Microsoft.ML.Predictor.Tests/TestPredictors.cs b/test/Microsoft.ML.Predictor.Tests/TestPredictors.cs index b2e6095d7f..2259d91859 100644 --- a/test/Microsoft.ML.Predictor.Tests/TestPredictors.cs +++ b/test/Microsoft.ML.Predictor.Tests/TestPredictors.cs @@ -192,7 +192,7 @@ public void MulticlassSdcaTest() /// /// Multiclass Logistic Regression test with a tree featurizer. /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Multiclass")] [TestCategory("Logistic Regression")] [TestCategory("FastTree")] @@ -239,7 +239,7 @@ public void KMeansClusteringTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] [TestCategory("SDCA")] public void LinearClassifierTest() @@ -260,7 +260,7 @@ public void LinearClassifierTest() /// ///A test for binary classifiers /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] public void BinaryClassifierLogisticRegressionTest() { @@ -270,7 +270,7 @@ public void BinaryClassifierLogisticRegressionTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] public void BinaryClassifierSymSgdTest() { @@ -282,7 +282,7 @@ public void BinaryClassifierSymSgdTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] public void BinaryClassifierTesterThresholdingTest() { @@ -308,7 +308,7 @@ public void BinaryClassifierLogisticRegressionNormTest() /// ///A test for binary classifiers with non-negative coefficients /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] public void BinaryClassifierLogisticRegressionNonNegativeTest() { @@ -334,7 +334,7 @@ public void BinaryClassifierLogisticRegressionBinNormTest() /// ///A test for binary classifiers /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] public void BinaryClassifierLogisticRegressionGaussianNormTest() { @@ -373,7 +373,7 @@ public void BinaryClassifierFastRankClassificationTest() /// ///A test for binary classifiers /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] [TestCategory("FastForest")] public void FastForestClassificationTest() @@ -440,7 +440,7 @@ public void WeightingFastForestRegressionPredictorsTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] [TestCategory("FastTree")] public void FastTreeBinaryClassificationTest() @@ -459,7 +459,7 @@ public void FastTreeBinaryClassificationTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only [TestCategory("Binary")] [TestCategory("LightGBM")] public void LightGBMClassificationTest() @@ -475,7 +475,7 @@ public void LightGBMClassificationTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only [TestCategory("Binary"), TestCategory("LightGBM")] public void GossLightGBMTest() { @@ -485,7 +485,7 @@ public void GossLightGBMTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only [TestCategory("Binary")] [TestCategory("LightGBM")] public void DartLightGBMTest() @@ -499,7 +499,7 @@ public void DartLightGBMTest() /// /// A test for multi class classifiers. /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only [TestCategory("Multiclass")] [TestCategory("LightGBM")] public void MultiClassifierLightGBMKeyLabelTest() @@ -513,7 +513,7 @@ public void MultiClassifierLightGBMKeyLabelTest() /// /// A test for multi class classifiers. /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only [TestCategory("Multiclass")] [TestCategory("LightGBM")] public void MultiClassifierLightGBMKeyLabelU404Test() @@ -527,7 +527,7 @@ public void MultiClassifierLightGBMKeyLabelU404Test() /// /// A test for regression. /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only [TestCategory("Regression")] [TestCategory("LightGBM")] public void RegressorLightGBMTest() @@ -541,7 +541,7 @@ public void RegressorLightGBMTest() /// /// A test for regression. /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only [TestCategory("Regression")] [TestCategory("LightGBM")] public void RegressorLightGBMMAETest() @@ -555,7 +555,7 @@ public void RegressorLightGBMMAETest() /// /// A test for regression. /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only [TestCategory("Regression")] [TestCategory("LightGBM")] public void RegressorLightGBMRMSETest() @@ -587,7 +587,7 @@ public void RankingLightGBMTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 fails with "Unknown command: 'train'; Format error at (83,3)-(83,4011): Illegal quoting" public void TestTreeEnsembleCombiner() { var dataPath = GetDataPath("breast-cancer.txt"); @@ -611,7 +611,7 @@ public void TestTreeEnsembleCombiner() CombineAndTestTreeEnsembles(dataView, fastTrees); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 fails with "Unknown command: 'train'; Format error at (83,3)-(83,4011): Illegal quoting" public void TestTreeEnsembleCombinerWithCategoricalSplits() { var dataPath = GetDataPath("adult.tiny.with-schema.txt"); @@ -705,7 +705,7 @@ private void CombineAndTestTreeEnsembles(IDataView idv, IPredictorModel[] fastTr } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] [TestCategory("FastTree")] public void FastTreeBinaryClassificationCategoricalSplitTest() @@ -744,7 +744,7 @@ public void FastTreeRegressionCategoricalSplitTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] [TestCategory("FastTree")] public void FastTreeBinaryClassificationNoOpGroupIdTest() @@ -764,7 +764,7 @@ public void FastTreeBinaryClassificationNoOpGroupIdTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Binary")] [TestCategory("FastTree")] public void FastTreeHighMinDocsTest() @@ -1363,7 +1363,7 @@ public void PAVCalibratorPerceptronTest() /// ///A test for random calibrators /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline [TestCategory("Calibrator")] public void RandomCalibratorPerceptronTest() { diff --git a/test/Microsoft.ML.StaticPipelineTesting/Training.cs b/test/Microsoft.ML.StaticPipelineTesting/Training.cs index 218a2cec73..9f4f737b27 100644 --- a/test/Microsoft.ML.StaticPipelineTesting/Training.cs +++ b/test/Microsoft.ML.StaticPipelineTesting/Training.cs @@ -406,7 +406,7 @@ public void FastTreeRegression() Assert.InRange(metrics.LossFn, 0, double.PositiveInfinity); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only public void LightGbmBinaryClassification() { var env = new ConsoleEnvironment(seed: 0); @@ -446,7 +446,7 @@ public void LightGbmBinaryClassification() Assert.InRange(metrics.Auprc, 0, 1); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only public void LightGbmRegression() { var env = new ConsoleEnvironment(seed: 0); diff --git a/test/Microsoft.ML.TestFramework/BaseTestBaseline.cs b/test/Microsoft.ML.TestFramework/BaseTestBaseline.cs index fe05ce5b8a..ab744a1719 100644 --- a/test/Microsoft.ML.TestFramework/BaseTestBaseline.cs +++ b/test/Microsoft.ML.TestFramework/BaseTestBaseline.cs @@ -343,9 +343,9 @@ public void Dispose() /// /// Compare the contents of an output file with its baseline. /// - protected bool CheckEquality(string dir, string name, string nameBase = null) + protected bool CheckEquality(string dir, string name, string nameBase = null, int digitsOfPrecision = DigitsOfPrecision) { - return CheckEqualityCore(dir, name, nameBase ?? name, false); + return CheckEqualityCore(dir, name, nameBase ?? name, false, digitsOfPrecision); } /// diff --git a/test/Microsoft.ML.TestFramework/TestCategory.cs b/test/Microsoft.ML.TestFramework/TestCategory.cs deleted file mode 100644 index 69913b3fc9..0000000000 --- a/test/Microsoft.ML.TestFramework/TestCategory.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Xunit.Abstractions; -using Xunit.Sdk; - -namespace Xunit -{ - /// - /// This is a replacement for the MSTest [TestCategoryAttribute] on xunit - /// xunit does not have the concept of Category for tests and instead, the have [TraitAttribute(string key, string value)] - /// If we replace the MSTest [TestCategoryAttribute] for the [Trait("Category", "BVT")], we will surely fall at some time in cases - /// where people will typo on the "Category" key part of the Trait. - /// On order to achieve the same behaviour as on MSTest, a custom [TestCategory] was created - /// to mimic the MSTest one and avoid replace it on every existent test. - /// The tests can be filtered by xunit runners by usage of "-trait" on the command line with the expresion like - /// -trait "Category=BVT" for example that will only run the tests with [TestCategory("BVT")] on it. - /// - [TraitDiscoverer("CategoryDiscoverer", "TestExtensions")] - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] - public class TestCategoryAttribute : Attribute, ITraitAttribute - { - public TestCategoryAttribute(string category) { } - } - - public class CategoryDiscoverer : ITraitDiscoverer - { - public IEnumerable> GetTraits(IAttributeInfo traitAttribute) - { - var ctorArgs = traitAttribute.GetConstructorArguments().ToList(); - yield return new KeyValuePair("Category", ctorArgs[0].ToString()); - } - } -} diff --git a/test/Microsoft.ML.TestFramework/TestCommandBase.cs b/test/Microsoft.ML.TestFramework/TestCommandBase.cs index 4e225de8b4..b5e2766727 100644 --- a/test/Microsoft.ML.TestFramework/TestCommandBase.cs +++ b/test/Microsoft.ML.TestFramework/TestCommandBase.cs @@ -820,7 +820,7 @@ public void CommandCrossValidation() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline public void CommandCrossValidationKeyLabelWithFloatKeyValues() { RunMTAThread(() => diff --git a/test/Microsoft.ML.Tests/Microsoft.ML.Tests.csproj b/test/Microsoft.ML.Tests/Microsoft.ML.Tests.csproj index df954873b3..b171f91c74 100644 --- a/test/Microsoft.ML.Tests/Microsoft.ML.Tests.csproj +++ b/test/Microsoft.ML.Tests/Microsoft.ML.Tests.csproj @@ -35,6 +35,10 @@ + + + + diff --git a/test/Microsoft.ML.Tests/OnnxTests.cs b/test/Microsoft.ML.Tests/OnnxTests.cs index 11604969a1..ed7ce713d2 100644 --- a/test/Microsoft.ML.Tests/OnnxTests.cs +++ b/test/Microsoft.ML.Tests/OnnxTests.cs @@ -268,7 +268,7 @@ public void KeyToVectorWithBagTest() Done(); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only public void BinaryClassificationLightGBMSaveModelToOnnxTest() { string dataPath = GetDataPath(@"breast-cancer.txt"); diff --git a/test/Microsoft.ML.Tests/Scenarios/SentimentPredictionTests.cs b/test/Microsoft.ML.Tests/Scenarios/SentimentPredictionTests.cs index e0517bbdd1..00e7997dd5 100644 --- a/test/Microsoft.ML.Tests/Scenarios/SentimentPredictionTests.cs +++ b/test/Microsoft.ML.Tests/Scenarios/SentimentPredictionTests.cs @@ -9,6 +9,7 @@ using Microsoft.ML.Runtime; using Microsoft.ML.Runtime.Api; using Microsoft.ML.Runtime.Data; +using System; using System.Collections.Generic; using System.Linq; using Xunit; @@ -44,7 +45,7 @@ public void TrainAndPredictSymSGDSentimentModelTest() ValidateBinaryMetricsSymSGD(metrics); } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only public void TrainAndPredictLightGBMSentimentModelTest() { var pipeline = PreparePipelineLightGBM(); diff --git a/test/Microsoft.ML.Tests/Scenarios/TensorflowTests.cs b/test/Microsoft.ML.Tests/Scenarios/TensorflowTests.cs index f9a76d5c92..641440c362 100644 --- a/test/Microsoft.ML.Tests/Scenarios/TensorflowTests.cs +++ b/test/Microsoft.ML.Tests/Scenarios/TensorflowTests.cs @@ -6,6 +6,7 @@ using Microsoft.ML.Legacy.Transforms; using Microsoft.ML.Runtime.Api; using Microsoft.ML.Transforms.TensorFlow; +using System; using System.IO; using Xunit; @@ -13,7 +14,7 @@ namespace Microsoft.ML.Scenarios { public partial class ScenariosTests { - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowTransformCifarLearningPipelineTest() { var imageHeight = 32; diff --git a/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs b/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs index 28493924a8..96c8e89da9 100644 --- a/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs +++ b/test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs @@ -27,7 +27,7 @@ private class TestData public float[] b; } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowTransformMatrixMultiplicationTest() { var model_location = "model_matmul/frozen_saved_model.pb"; @@ -182,7 +182,7 @@ public void TensorFlowTransformInceptionTest() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowInputsOutputsSchemaTest() { using (var env = new ConsoleEnvironment(seed: 1, conc: 1)) @@ -271,7 +271,7 @@ public void TensorFlowInputsOutputsSchemaTest() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowTransformMNISTConvTest() { var model_location = "mnist_model/frozen_saved_model.pb"; @@ -590,7 +590,7 @@ public void TensorFlowTransformMNISTConvTemplateTrainingTest() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowTransformMNISTConvSavedModelTest() { var model_location = "mnist_model"; @@ -672,7 +672,7 @@ public void TensorFlowTransformMNISTConvSavedModelTest() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowTransformMNISTConvPipelineTest() { var model_location = "mnist_model/frozen_saved_model.pb"; @@ -728,7 +728,7 @@ public class MNISTPrediction public float[] PredictedLabels; } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowTransformCifar() { var model_location = "cifar_model/frozen_model.pb"; @@ -789,7 +789,7 @@ public void TensorFlowTransformCifar() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TensorFlowTransformCifarSavedModel() { var model_location = "cifar_saved_model"; diff --git a/test/Microsoft.ML.Tests/TensorFlowEstimatorTests.cs b/test/Microsoft.ML.Tests/TensorFlowEstimatorTests.cs index e75e7701db..6d139a7cfc 100644 --- a/test/Microsoft.ML.Tests/TensorFlowEstimatorTests.cs +++ b/test/Microsoft.ML.Tests/TensorFlowEstimatorTests.cs @@ -53,7 +53,7 @@ public TensorFlowEstimatorTests(ITestOutputHelper output) : base(output) { } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only void TestSimpleCase() { var modelFile = "model_matmul/frozen_saved_model.pb"; @@ -93,7 +93,7 @@ void TestSimpleCase() catch (InvalidOperationException) { } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only void TestOldSavingAndLoading() { var modelFile = "model_matmul/frozen_saved_model.pb"; @@ -129,7 +129,7 @@ void TestOldSavingAndLoading() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // x86 output differs from Baseline void TestCommandLine() { using (var env = new ConsoleEnvironment()) @@ -138,7 +138,7 @@ void TestCommandLine() } } - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // TensorFlow is 64-bit only public void TestTensorFlowStatic() { var modelLocation = "cifar_model/frozen_model.pb"; diff --git a/test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs b/test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs index 8d882ed535..1ad45e55a4 100644 --- a/test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs +++ b/test/Microsoft.ML.Tests/TrainerEstimators/TreeEstimators.cs @@ -6,6 +6,7 @@ using Microsoft.ML.Runtime.FastTree; using Microsoft.ML.Runtime.LightGBM; using Microsoft.ML.Runtime.RunTests; +using System; using System.Linq; using Xunit; @@ -125,7 +126,7 @@ public void FastTreeRegressorEstimator() /// /// FastTreeRegressor TrainerEstimator test /// - [Fact] + [ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))] // LightGBM is 64-bit only public void LightGBMRegressorEstimator() { diff --git a/test/Microsoft.ML.Tests/Transformers/NormalizerTests.cs b/test/Microsoft.ML.Tests/Transformers/NormalizerTests.cs index 8f6cd18428..5ab89906d7 100644 --- a/test/Microsoft.ML.Tests/Transformers/NormalizerTests.cs +++ b/test/Microsoft.ML.Tests/Transformers/NormalizerTests.cs @@ -6,6 +6,7 @@ using Microsoft.ML.Runtime.Data.IO; using Microsoft.ML.Runtime.RunTests; using Microsoft.ML.Transforms; +using System; using System.IO; using Xunit; using Xunit.Abstractions; @@ -136,7 +137,7 @@ public void LpGcNormAndWhiteningWorkout() DataSaverUtils.SaveDataView(ch, saver, savedData, fs, keepHidden: true); } - CheckEquality("Text", "lpnorm_gcnorm_whitened.tsv"); + CheckEquality("Text", "lpnorm_gcnorm_whitened.tsv", digitsOfPrecision: 4); Done(); } } diff --git a/test/Microsoft.ML.TimeSeries.Tests/TimeSeriesDirectApi.cs b/test/Microsoft.ML.TimeSeries.Tests/TimeSeriesDirectApi.cs index 50591e07d4..b0abe45a8a 100644 --- a/test/Microsoft.ML.TimeSeries.Tests/TimeSeriesDirectApi.cs +++ b/test/Microsoft.ML.TimeSeries.Tests/TimeSeriesDirectApi.cs @@ -117,10 +117,10 @@ public void ChangePointDetectionWithSeasonality() while (enumerator.MoveNext() && index < expectedValues.Count) { row = enumerator.Current; - Assert.Equal(expectedValues[index++], row.Change[0]); - Assert.Equal(expectedValues[index++], row.Change[1]); - Assert.Equal(expectedValues[index++], row.Change[2]); - Assert.Equal(expectedValues[index++], row.Change[3]); + Assert.Equal(expectedValues[index++], row.Change[0], precision: 7); + Assert.Equal(expectedValues[index++], row.Change[1], precision: 7); + Assert.Equal(expectedValues[index++], row.Change[2], precision: 7); + Assert.Equal(expectedValues[index++], row.Change[3], precision: 7); } } }