Exemplo n.º 1
0
 /// <summary>
 /// Override symbolic dimensions (by specific denotation strings) with actual values if known at session initialization time to enable
 /// optimizations that can take advantage of fixed values (such as memory planning, etc)
 /// </summary>
 public void AddFreeDimensionOverride(string dimDenotation, long dimValue)
 {
     var utf8DimDenotationPinned = GCHandle.Alloc(NativeOnnxValueHelper.StringToZeroTerminatedUtf8(dimDenotation), GCHandleType.Pinned);
     using (var pinnedDimDenotation = new PinnedGCHandle(utf8DimDenotationPinned))
     {
         NativeApiStatus.VerifySuccess(NativeMethods.OrtAddFreeDimensionOverride(handle, pinnedDimDenotation.Pointer, dimValue));
     }
 }