Skip to content

Commit 1be3b64

Browse files
committed
update readme for .net support
1 parent d355c1c commit 1be3b64

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,42 @@ There is a breaking change in the **arguments** property in CNTK python API. The
158158
- Updated `Min`/`Max` import implementation to handle variadic inputs.
159159
- Fixed possible file corruption when resaving on top of existing ONNX model file.
160160

161+
## .Net Support
162+
The Cntk.Core.Managed library has officially been converted to .Net Standard and supports .Net Core and .Net Framework applications on both Windows and Linux. Starting from this release, .Net developers should be able to restore CNTK Nuget packages using new .Net SDK style project file with package management format set to PackageReference.
163+
164+
The following C# code now works on both Windows and Linux:
165+
166+
>>> var weightParameterName = "weight";
167+
>>> var biasParameterName = "bias";
168+
>>> var inputName = "input";
169+
>>> var outputDim = 2;
170+
>>> var inputDim = 3;
171+
>>> Variable inputVariable = Variable.InputVariable(new int[] { inputDim }, DataType.Float, inputName);
172+
>>> var weightParameter = new Parameter(new int[] { outputDim, inputDim }, DataType.Float, 1, device, weightParameterName);
173+
>>> var biasParameter = new Parameter(new int[] { outputDim }, DataType.Float, 0, device, biasParameterName);
174+
>>>
175+
>>> Function modelFunc = CNTKLib.Times(weightParameter, inputVariable) + biasParameter;
176+
177+
For example, simply adding an ItemGroup clause in the .csproj file of a .Net Core application is sufficient:
178+
>>> <Project Sdk="Microsoft.NET.Sdk">
179+
>>>
180+
>>> <PropertyGroup>
181+
>>> <TargetFramework>netcoreapp2.1</TargetFramework>
182+
>>> <Platforms>x64</Platforms>
183+
>>> </PropertyGroup>
184+
>>>
185+
>>> <ItemGroup>
186+
>>> <PackageReference Include="CNTK.GPU" Version="2.6.0" />
187+
>>> </ItemGroup>
188+
>>>
189+
>>> </Project>
190+
191+
### Bug or minor fixes:
192+
- Fixed C# string and char to native wstring and wchar UTF conversion issues on Linux.
193+
- Fixed multibyte and wide character conversions across the codebase.
194+
- Fixed Nuget package mechanism to pack for .Net Standard.
195+
- Fixed a memory leak issue in Value class in C# API where Dispose was not called upon object destruction.
196+
161197
## Misc
162198

163199

0 commit comments

Comments
 (0)