Skip to content

Commit 9ebc122

Browse files
committed
Internalize ICommand and all implementations
1 parent fe1641f commit 9ebc122

File tree

33 files changed

+66
-90
lines changed

33 files changed

+66
-90
lines changed

Microsoft.ML.sln

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CpuMath", "src
1717
EndProject
1818
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.PipelineInference", "src\Microsoft.ML.PipelineInference\Microsoft.ML.PipelineInference.csproj", "{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}"
1919
EndProject
20-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.InferenceTesting", "test\Microsoft.ML.InferenceTesting\Microsoft.ML.InferenceTesting.csproj", "{E278EC99-E6EE-49FE-92E6-0A309A478D98}"
21-
EndProject
2220
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Data", "src\Microsoft.ML.Data\Microsoft.ML.Data.csproj", "{AD92D96B-0E96-4F22-8DCE-892E13B1F282}"
2321
EndProject
2422
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Onnx", "src\Microsoft.ML.Onnx\Microsoft.ML.Onnx.csproj", "{65D0603E-B96C-4DFC-BDD1-705891B88C18}"
@@ -175,14 +173,6 @@ Global
175173
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Release|Any CPU.Build.0 = Release|Any CPU
176174
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU
177175
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU
178-
{E278EC99-E6EE-49FE-92E6-0A309A478D98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
179-
{E278EC99-E6EE-49FE-92E6-0A309A478D98}.Debug|Any CPU.Build.0 = Debug|Any CPU
180-
{E278EC99-E6EE-49FE-92E6-0A309A478D98}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU
181-
{E278EC99-E6EE-49FE-92E6-0A309A478D98}.Debug-Intrinsics|Any CPU.Build.0 = Debug-Intrinsics|Any CPU
182-
{E278EC99-E6EE-49FE-92E6-0A309A478D98}.Release|Any CPU.ActiveCfg = Release|Any CPU
183-
{E278EC99-E6EE-49FE-92E6-0A309A478D98}.Release|Any CPU.Build.0 = Release|Any CPU
184-
{E278EC99-E6EE-49FE-92E6-0A309A478D98}.Release-Intrinsics|Any CPU.ActiveCfg = Release-Intrinsics|Any CPU
185-
{E278EC99-E6EE-49FE-92E6-0A309A478D98}.Release-Intrinsics|Any CPU.Build.0 = Release-Intrinsics|Any CPU
186176
{AD92D96B-0E96-4F22-8DCE-892E13B1F282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
187177
{AD92D96B-0E96-4F22-8DCE-892E13B1F282}.Debug|Any CPU.Build.0 = Debug|Any CPU
188178
{AD92D96B-0E96-4F22-8DCE-892E13B1F282}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug-Intrinsics|Any CPU
@@ -520,7 +510,6 @@ Global
520510
{EC743D1D-7691-43B7-B9B0-5F2F7018A8F6} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
521511
{46F2F967-C23F-4076-858D-33F7DA9BD2DA} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
522512
{2D7391C9-8254-4B8F-BF26-FADAF8F02F44} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
523-
{E278EC99-E6EE-49FE-92E6-0A309A478D98} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
524513
{AD92D96B-0E96-4F22-8DCE-892E13B1F282} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
525514
{65D0603E-B96C-4DFC-BDD1-705891B88C18} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
526515
{707BB22C-7E5F-497A-8C2F-74578F675705} = {09EADF06-BE25-4228-AB53-95AE3E15B530}

src/Microsoft.ML.Api/GenerateCodeCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Microsoft.ML.Runtime.Api
2424
///
2525
/// REVIEW: Consider adding support for generating VBuffers instead of arrays, maybe for high dimensionality vectors.
2626
/// </summary>
27-
public sealed class GenerateCodeCommand : ICommand
27+
internal sealed class GenerateCodeCommand : ICommand
2828
{
2929
public const string LoadName = "GenerateSamplePredictionCode";
3030
private const string CodeTemplatePath = "Microsoft.ML.Api.GeneratedCodeTemplate.csresource";

src/Common/AssemblyLoadingUtils.cs renamed to src/Microsoft.ML.Core/ComponentModel/AssemblyLoadingUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
using System;
77
using System.IO;
88
using System.IO.Compression;
9-
using System.Linq;
109
using System.Reflection;
1110

1211
namespace Microsoft.ML.Runtime
1312
{
13+
[BestFriend]
1414
internal static class AssemblyLoadingUtils
1515
{
1616
/// <summary>

src/Microsoft.ML.Core/Data/ICommand.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ namespace Microsoft.ML.Runtime.Command
1111
/// <summary>
1212
/// The signature for commands.
1313
/// </summary>
14-
public delegate void SignatureCommand();
14+
[BestFriend]
15+
internal delegate void SignatureCommand();
1516

16-
public interface ICommand
17+
[BestFriend]
18+
internal interface ICommand
1719
{
1820
void Run();
1921
}

src/Microsoft.ML.Data/Commands/EvaluateCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public static IDataTransform Create(IHostEnvironment env, Arguments args, IDataV
162162
}
163163
}
164164

165-
public sealed class EvaluateCommand : DataCommand.ImplBase<EvaluateCommand.Arguments>
165+
internal sealed class EvaluateCommand : DataCommand.ImplBase<EvaluateCommand.Arguments>
166166
{
167167
public sealed class Arguments : DataCommand.ArgumentsBase
168168
{

src/Microsoft.ML.Data/Commands/SaveDataCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
namespace Microsoft.ML.Runtime.Data
2424
{
25-
public sealed class SaveDataCommand : DataCommand.ImplBase<SaveDataCommand.Arguments>
25+
internal sealed class SaveDataCommand : DataCommand.ImplBase<SaveDataCommand.Arguments>
2626
{
2727
public sealed class Arguments : DataCommand.ArgumentsBase
2828
{
@@ -87,7 +87,7 @@ private void RunCore(IChannel ch)
8787
}
8888
}
8989

90-
public sealed class ShowDataCommand : DataCommand.ImplBase<ShowDataCommand.Arguments>
90+
internal sealed class ShowDataCommand : DataCommand.ImplBase<ShowDataCommand.Arguments>
9191
{
9292
public sealed class Arguments : DataCommand.ArgumentsBase
9393
{

src/Microsoft.ML.Data/Commands/SavePredictorCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace Microsoft.ML.Runtime.Tools
2222
{
23-
public sealed class SavePredictorCommand : ICommand
23+
internal sealed class SavePredictorCommand : ICommand
2424
{
2525
public sealed class Arguments
2626
{

src/Microsoft.ML.Data/Commands/ScoreCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public interface IDataScorerTransform : IDataTransform, ITransformTemplate
3737

3838
public delegate void SignatureBindableMapper(IPredictor predictor);
3939

40-
public sealed class ScoreCommand : DataCommand.ImplBase<ScoreCommand.Arguments>
40+
internal sealed class ScoreCommand : DataCommand.ImplBase<ScoreCommand.Arguments>
4141
{
4242
public sealed class Arguments : DataCommand.ArgumentsBase
4343
{

src/Microsoft.ML.Data/Commands/ShowSchemaCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace Microsoft.ML.Runtime.Data
2222
{
23-
public sealed class ShowSchemaCommand : DataCommand.ImplBase<ShowSchemaCommand.Arguments>
23+
internal sealed class ShowSchemaCommand : DataCommand.ImplBase<ShowSchemaCommand.Arguments>
2424
{
2525
public sealed class Arguments : DataCommand.ArgumentsBase
2626
{

src/Microsoft.ML.Data/Commands/TestCommand.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414

1515
namespace Microsoft.ML.Runtime.Data
1616
{
17-
// This command is essentially chaining together Score and Evaluate, without the need to save the intermediary scored data.
18-
public sealed class TestCommand : DataCommand.ImplBase<TestCommand.Arguments>
17+
/// <summary>
18+
/// This command is essentially chaining together <see cref="ScoreCommand"/> and
19+
/// <see cref="EvaluateCommand"/>, without the need to save the intermediary scored data.
20+
/// </summary>
21+
[BestFriend]
22+
internal sealed class TestCommand : DataCommand.ImplBase<TestCommand.Arguments>
1923
{
2024
public sealed class Arguments : DataCommand.ArgumentsBase
2125
{

0 commit comments

Comments
 (0)