@@ -22,7 +22,7 @@ public enum OnnxValueType
2222 ONNX_TYPE_MAP = 3 , // It's a map
2323 ONNX_TYPE_OPAQUE = 4 , // It's an experimental Opaque object
2424 ONNX_TYPE_SPARSETENSOR = 5 , // It's a Sparse Tensor
25- ONNX_TYPE_OPTIONAL = 6 , // It's an optional type that designates anything above (except UNKOWN )
25+ ONNX_TYPE_OPTIONAL = 6 , // It's an optional type that designates anything above (except UNKNOWN )
2626 }
2727
2828 /// <summary>
@@ -31,7 +31,7 @@ public enum OnnxValueType
3131 /// The class implements IDisposable and must
3232 /// be disposed of, otherwise native resources will leak
3333 /// and will eventually cause the application to slow down or crash.
34- ///
34+ ///
3535 /// If the OrtValue instance is constructed over a managed memory, and it is not
3636 /// disposed properly, the pinned memory will continue to be pinned and interfere
3737 /// with GC operation.
@@ -72,7 +72,7 @@ internal OrtValue(IntPtr handle, OnnxValueType onnxValueType)
7272 /// Constructor. The newly constructed OrtValue takes ownership of the native OrtValue instance
7373 /// and disposes of it when the OrtValue instance is disposed. The instance will take ownership and will
7474 /// dispose of compositeMembers instances.
75- ///
75+ ///
7676 /// This constructor can only throw if OnnxType is not specified.
7777 /// </summary>
7878 /// <param name="handle">native ortValue handle</param>
@@ -189,10 +189,10 @@ public OrtValue GetValue(int index, OrtAllocator allocator)
189189 /// <summary>
190190 /// Returns a ReadOnlySpan<typeparamref name="T"/> over tensor native buffer that
191191 /// provides a read-only view.
192- ///
192+ ///
193193 /// Note, that the memory may be device allocated and, therefore, not accessible from the CPU.
194194 /// To get memory descriptor use GetTensorMemoryInfo().
195- ///
195+ ///
196196 /// OrtValue must contain a non-string tensor.
197197 /// The span is valid as long as the OrtValue instance is alive (not disposed).
198198 /// </summary>
@@ -210,10 +210,10 @@ public ReadOnlySpan<T> GetTensorDataAsSpan<T>() where T : unmanaged
210210 /// This enables you to safely and efficiently modify the underlying
211211 /// native buffer in a type-safe manner. This is useful for example in IOBinding scenarios
212212 /// where you want to modify results of the inference and feed it back as input.
213- ///
213+ ///
214214 /// Note, that the memory may be device allocated.
215215 /// To get memory descriptor use GetTensorMemoryInfo().
216- ///
216+ ///
217217 /// OrtValue must contain a non-string tensor.
218218 /// The span is valid as long as the OrtValue instance is alive (not disposed).
219219 /// </summary>
@@ -237,7 +237,7 @@ public Span<byte> GetTensorMutableRawData()
237237 /// <summary>
238238 /// Fetch string tensor element buffer pointer at the specified index,
239239 /// convert/copy to UTF-16 char[] and return a ReadOnlyMemory<char> instance.
240- ///
240+ ///
241241 /// Obtain TensorTypeAndShape to get shape and element count.
242242 /// </summary>
243243 /// <param name="index">flat string tensor element index</param>
@@ -256,7 +256,7 @@ public ReadOnlyMemory<char> GetStringElementAsMemory(int index)
256256 /// <summary>
257257 /// Fetch string tensor element buffer pointer at the specified index,
258258 /// copy/convert UTF-8 into a UTF-16 string and return it.
259- ///
259+ ///
260260 /// Obtain TensorTypeAndShape to get shape and element count.
261261 /// </summary>
262262 /// <param name="index">flat string tensor element index</param>
@@ -279,7 +279,7 @@ public string GetStringElement(int index)
279279 /// <summary>
280280 /// Get a span over the native memory of the string tensor element.
281281 /// The span is valid as long as the OrtValue is valid.
282- ///
282+ ///
283283 /// This is useful if you want to perform your own UTF-8 decoding or
284284 /// you do not care about decoding.
285285 /// Obtain TensorTypeAndShape to get shape and element count.
@@ -483,7 +483,7 @@ private Span<byte> GetTensorBufferRawData(Type requestedType)
483483 /// This can be a piece of arbitrary memory that may be allocated by OrtAllocator (possibly on a device),
484484 /// a chunk of managed memory (must be pinned for the duration of OrtValue lifetime) or a memory that is allocated
485485 /// natively allocated using Marshal.AllocHGlobal(), stackalloc or other means (may be on a device).
486- ///
486+ ///
487487 /// The resulting OrtValue does not own the underlying memory buffer and will not attempt to
488488 /// deallocate it. The caller must make sure that the memory remains valid for the duration of OrtValue lifetime.
489489 /// </summary>
@@ -769,12 +769,12 @@ out IntPtr valueHandle
769769 /// Converts the string argument represented by ReadOnlySpan to UTF-8,
770770 /// allocates space in the native tensor and copies it into the native tensor memory.
771771 /// Typically, this is used to populate a new empty string tensor element.
772- ///
772+ ///
773773 /// The number of elements is according to the shape supplied to CreateTensorWithEmptyStrings().
774774 /// However, this API can also be used to overwrite any existing element within the string tensor.
775- ///
775+ ///
776776 /// In general, to obtain the number of elements for any tensor, use GetTensorTypeAndShape() which
777- /// would return a disposable instance of TensorTypeAndShapeInfo.
777+ /// would return a disposable instance of TensorTypeAndShapeInfo.
778778 /// Then call GetElementCount() or GetShape().
779779 /// </summary>
780780 /// <param name="str">ReadOnlySpan over chars</param>
@@ -795,12 +795,12 @@ public void StringTensorSetElementAt(ReadOnlySpan<char> str, int index)
795795 /// Converts the string argument represented by ReadOnlyMemory to UTF-8,
796796 /// allocates space in the native tensor and copies it into the native tensor memory.
797797 /// Typically, this is used to populate a new empty string tensor element.
798- ///
798+ ///
799799 /// The number of elements is according to the shape supplied to CreateTensorWithEmptyStrings().
800800 /// However, this API can also be used to overwrite any existing element within the string tensor.
801- ///
801+ ///
802802 /// In general, to obtain the number of elements for any tensor, use GetTensorTypeAndShape() which
803- /// would return a disposable instance of TensorTypeAndShapeInfo.
803+ /// would return a disposable instance of TensorTypeAndShapeInfo.
804804 /// Then call GetElementCount() or GetShape().
805805 ///
806806 /// </summary>
@@ -815,7 +815,7 @@ public void StringTensorSetElementAt(ReadOnlyMemory<char> rom, int index)
815815 /// <summary>
816816 /// This API resizes String Tensor element to the requested amount of bytes (UTF-8)
817817 /// and copies the bytes from the supplied ReadOnlySpan into the native tensor memory (resized buffer).
818- ///
818+ ///
819819 /// The API is useful for quick loading of utf8 data into the native tensor memory.
820820 /// </summary>
821821 /// <param name="utf8Bytes">read only span of bytes</param>
@@ -841,7 +841,7 @@ public void StringTensorSetElementAt(ReadOnlySpan<byte> utf8Bytes, int index)
841841 /// Creates an OrtValue that contains a string tensor.
842842 /// String tensors are always allocated on CPU.
843843 /// String data will be converted to UTF-8 and copied to native memory.
844- ///
844+ ///
845845 /// Note, this is different from creating an OrtValue from other primitive data types
846846 /// where memory is pinned (if necessary) and the OrtValue points to that chunk of memory.
847847 /// </summary>
@@ -885,10 +885,10 @@ public static OrtValue CreateFromStringTensor(Tensor<string> tensor)
885885 /// Creates a sequence of OrtValues from a collection of OrtValues.
886886 /// All OrtValues in the collection must be of the same Onnx type.
887887 /// I.e. (Tensor, SparseTensor, Map, Sequence, etc.)
888- ///
888+ ///
889889 /// The ortValues that are passed as argument are taken possession of by the newly
890890 /// created OrtValue. The caller should not dispose them, unless this call fails.
891- ///
891+ ///
892892 /// The ortValues would be empty on successful return.
893893 /// </summary>
894894 /// <param name="ortValues">a collection of OrtValues. On success the ortValues contained in the list
@@ -978,24 +978,24 @@ public void ProcessSequence(SequenceElementVisitor visitor, OrtAllocator allocat
978978 /// Creates a map OrtValue with keys and values.
979979 /// On a high level the Onnxruntime representation of the map always consists of two
980980 /// OrtValues, keys and values.
981- ///
981+ ///
982982 /// According to ONNX standard map keys can be unmanaged types only (or strings).
983983 /// Those keys are contained in a single tensor within OrtValue keys.
984- ///
984+ ///
985985 /// Map values, on the other hand, can be composite types. The values parameter
986986 /// can either contain a single tensor with unmanaged map values with the same number of
987987 /// elements as the keys, or it can be a sequence of OrtValues,
988988 /// each of those can be a composite type (tensor, sequence, map). If it is a sequence,
989989 /// then the number of elements must match the number of elements in keys.
990- ///
990+ ///
991991 /// Keys and values must be in the same order.
992- ///
992+ ///
993993 /// ORT supports only a subset of types for keys and values, however, this API does not
994994 /// restrict it.
995- ///
995+ ///
996996 /// The ortValues that are passed as argument are taken possession of by the newly
997997 /// created OrtValue. The caller should not dispose them, unless this call fails.
998- ///
998+ ///
999999 /// Keys and values arguments will be set to null on success.
10001000 /// </summary>
10011001 /// <param name="keys">Contains keys</param>
@@ -1031,10 +1031,10 @@ public static OrtValue CreateMap(ref OrtValue keys, ref OrtValue values)
10311031 /// This API helps to quickly creates a map OrtValue with unmanaged (primitive) keys and values specified as arrays.
10321032 /// This helps the user not to create OrtValues for keys and values separately and deal only with the final result.
10331033 /// The map would consist of two tensors, one for keys and one for values.
1034- ///
1034+ ///
10351035 /// The OrtValues would be created on top of the managed memory arrays and use it directly.
10361036 /// The number of elements in keys and values must be the same and they must be in order.
1037- ///
1037+ ///
10381038 /// The types must be unmanaged.
10391039 /// </summary>
10401040 /// <typeparam name="K">keys type</typeparam>
@@ -1078,10 +1078,10 @@ public static OrtValue CreateMap<K, V>(K[] keys, V[] values) where K : unmanaged
10781078 /// This helps the user not to create OrtValues for keys and values separately.
10791079 /// The number of elements in keys and values must be the same and they must be in order.
10801080 /// The map would consist of two tensors, one for keys and one for values.
1081- ///
1081+ ///
10821082 /// string keys would be converted to UTF-8 encoding and copied to an allocated native memory.
10831083 /// The OrtValue for values would be created on top of the managed memory using it directly.
1084- ///
1084+ ///
10851085 /// The values type must be unmanaged.
10861086 /// </summary>
10871087 /// <typeparam name="V"></typeparam>
@@ -1128,13 +1128,13 @@ public static OrtValue CreateMapWithStringKeys<V>(IReadOnlyCollection<string> ke
11281128
11291129 /// <summary>
11301130 /// Creates a map OrtValue with non-string keys and string values.
1131- ///
1131+ ///
11321132 /// This helps the user not to create OrtValues for keys and values separately.
11331133 /// The number of elements in keys and values must be the same and they must be in order.
1134- ///
1134+ ///
11351135 /// The OrtValue for keys would be created on top of the managed memory using it directly.
11361136 /// string values would be converted to UTF-8 encoding and copied to an allocated native memory.
1137- ///
1137+ ///
11381138 /// </summary>
11391139 /// <typeparam name="K">unmanaged type of keys</typeparam>
11401140 /// <param name="keys"></param>
@@ -1182,17 +1182,17 @@ public static OrtValue CreateMapWithStringValues<K>(K[] keys, IReadOnlyCollectio
11821182 /// Typically, when one uses GetValue() API, it creates a copy of OrtValue
11831183 /// that points to the same buffer as keys or values. This API helps to deal with those
11841184 /// temporary instances and avoid leaks.
1185- ///
1185+ ///
11861186 /// According to ONNX standard map keys can be unmanaged types only (or strings).
11871187 /// Those keys are contained in a single tensor within OrtValue keys. So you can query those
11881188 /// directly from keys argument.
1189- ///
1189+ ///
11901190 /// Map values, on the other hand, can be composite types. The values parameter
11911191 /// can either contain a single tensor with unmanaged map values with the same number of
11921192 /// elements as the keys, or it can be a sequence of OrtValues,
11931193 /// each of those can be a composite type (tensor, sequence, map). If it is a sequence,
11941194 /// then the number of elements must match the number of elements in keys.
1195- ///
1195+ ///
11961196 /// Depending on the structure of the values, one will either directly query a single tensor
11971197 /// from values, or will have to iterate over the sequence of OrtValues and visit each of those
11981198 /// resulting in a recursive visitation.
@@ -1204,7 +1204,7 @@ public static OrtValue CreateMapWithStringValues<K>(K[] keys, IReadOnlyCollectio
12041204 /// <summary>
12051205 /// This API helps the user to process a map OrtValue without
12061206 /// having to deal with the lifespan of intermediate OrtValues.
1207- ///
1207+ ///
12081208 /// each API value is fed to the vistor functor.
12091209 /// </summary>
12101210 /// <param name="visitor">visitor function</param>
0 commit comments