Skip to content

Commit ba59364

Browse files
authored
Remove and combine Microsoft.ML.UniversalModelFormat.Onnx with Microsoft.ML.Model.OnnxConverter. (#2722)
1 parent d6a4b1d commit ba59364

File tree

8 files changed

+139
-139
lines changed

8 files changed

+139
-139
lines changed

src/Microsoft.ML.OnnxConverter/OnnxContextImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Collections.Generic;
77
using System.Linq;
88
using Microsoft.Data.DataView;
9-
using Microsoft.ML.UniversalModelFormat.Onnx;
9+
using Microsoft.ML.Model.OnnxConverter;
1010

1111
namespace Microsoft.ML.Model.OnnxConverter
1212
{

src/Microsoft.ML.OnnxConverter/OnnxExportExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using Google.Protobuf;
88
using Microsoft.Data.DataView;
99
using Microsoft.ML.Model.OnnxConverter;
10-
using static Microsoft.ML.UniversalModelFormat.Onnx.OnnxCSharpToProtoWrapper;
10+
using static Microsoft.ML.Model.OnnxConverter.OnnxCSharpToProtoWrapper;
1111

1212
namespace Microsoft.ML
1313
{

src/Microsoft.ML.OnnxConverter/OnnxMl.cs

Lines changed: 129 additions & 129 deletions
Large diffs are not rendered by default.

src/Microsoft.ML.OnnxConverter/OnnxMl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
2. Download protobuf C# compiler version 3.0 or greater from
55
https://github.com/google/protobuf/tree/master/csharp
66
3. Add `option csharp_namespace =
7-
"Microsoft.ML.UniversalModelFormat.Onnx";` to `onnx-ml.proto3` right below `package ONNX_NAMESPACE;`
7+
"Microsoft.ML.Model.OnnxConverter";` to `onnx-ml.proto3` right below `package ONNX_NAMESPACE;`
88
4. Assuming the compiler and proto file are saved at
99
`E:\protobuf-csharp-port\lib` then run the following in command line to get C# code from the proto file:
1010
```
1111
protoc.exe -I="E:\protobuf-csharp-port\lib" --csharp_out="E:\protobuf-csharp-port\lib" "E:\protobuf-csharp-port\lib\onnx-ml.proto3"
1212
```
13-
5. Find-Replace `public` with `internal` in `OnnxMl.cs`, wrap the root class in OnnxMl.cs with `internal class OnnxCSharpToProtoWrapper and append '.OnnxCSharpToProtoWrapper` to `Microsoft.ML.UniversalModelFormat.Onnx` namespace prefix whereever there is an error`.
13+
5. Find-Replace `public` with `internal` in `OnnxMl.cs`, wrap the root class in OnnxMl.cs with `internal class OnnxCSharpToProtoWrapper and append '.OnnxCSharpToProtoWrapper` to `Microsoft.ML.Model.OnnxConverter` namespace prefix whereever there is an error`.
1414

1515
## The proto3 file is current as of 06/01/2018 and generated from onnx-ml.proto3 based on the following commit https://github.com/onnx/onnx/commit/33e9cd4182fe468675241fba4ae8a16c2f0bd82f

src/Microsoft.ML.OnnxConverter/OnnxNodeImpl.cs

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

55
using System;
66
using System.Collections.Generic;
7-
using static Microsoft.ML.UniversalModelFormat.Onnx.OnnxCSharpToProtoWrapper;
7+
using static Microsoft.ML.Model.OnnxConverter.OnnxCSharpToProtoWrapper;
88

99
namespace Microsoft.ML.Model.OnnxConverter
1010
{

src/Microsoft.ML.OnnxConverter/OnnxUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using Google.Protobuf;
1010
using Microsoft.Data.DataView;
1111
using Microsoft.ML.Data;
12-
using static Microsoft.ML.UniversalModelFormat.Onnx.OnnxCSharpToProtoWrapper;
12+
using static Microsoft.ML.Model.OnnxConverter.OnnxCSharpToProtoWrapper;
1313

1414
namespace Microsoft.ML.Model.OnnxConverter
1515
{
@@ -255,7 +255,7 @@ public static ModelProto MakeModel(List<NodeProto> nodes, string producerName, s
255255
model.Domain = domain;
256256
model.ProducerName = producerName;
257257
model.ProducerVersion = producerVersion;
258-
model.IrVersion = (long)UniversalModelFormat.Onnx.OnnxCSharpToProtoWrapper.Version.IrVersion;
258+
model.IrVersion = (long)OnnxCSharpToProtoWrapper.Version.IrVersion;
259259
model.ModelVersion = modelVersion;
260260
model.OpsetImport.Add(new OperatorSetIdProto() { Domain = "ai.onnx.ml", Version = 1 });
261261
model.OpsetImport.Add(new OperatorSetIdProto() { Domain = "", Version = 7 });

src/Microsoft.ML.OnnxConverter/SaveOnnxCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
using Microsoft.ML.Internal.Utilities;
1515
using Microsoft.ML.Model.OnnxConverter;
1616
using Newtonsoft.Json;
17-
using static Microsoft.ML.UniversalModelFormat.Onnx.OnnxCSharpToProtoWrapper;
17+
using static Microsoft.ML.Model.OnnxConverter.OnnxCSharpToProtoWrapper;
1818

1919
[assembly: LoadableClass(SaveOnnxCommand.Summary, typeof(SaveOnnxCommand), typeof(SaveOnnxCommand.Arguments), typeof(SignatureCommand),
2020
"Save ONNX", "SaveOnnx", DocName = "command/SaveOnnx.md")]

test/Microsoft.ML.Tests/OnnxConversionTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
using Newtonsoft.Json;
2121
using Xunit;
2222
using Xunit.Abstractions;
23-
using static Microsoft.ML.UniversalModelFormat.Onnx.OnnxCSharpToProtoWrapper;
23+
using static Microsoft.ML.Model.OnnxConverter.OnnxCSharpToProtoWrapper;
2424

2525
namespace Microsoft.ML.Tests
2626
{
@@ -40,7 +40,7 @@ public OnnxConversionTest(ITestOutputHelper output) : base(output)
4040
}
4141

4242
/// <summary>
43-
/// In this test, we convert a trained <see cref="TransformerChain"/> into ONNX <see cref="UniversalModelFormat.Onnx.OnnxCSharpToProtoWrapper.ModelProto"/> file and then
43+
/// In this test, we convert a trained <see cref="TransformerChain"/> into ONNX <see cref="ModelProto"/> file and then
4444
/// call <see cref="OnnxScoringEstimator"/> to evaluate that file. The outputs of <see cref="OnnxScoringEstimator"/> are checked against the original
4545
/// ML.NET model's outputs.
4646
/// </summary>

0 commit comments

Comments
 (0)