Skip to content

Commit 88336ff

Browse files
pengwaedgchen1
andauthored
Fix typos - 1st Wave (microsoft#21278)
### Description There are so many typos reported by the review dog, [Optional Lint] actions (example: https://github.com/microsoft/onnxruntime/actions/runs/9864564489/job/27239732367), this PR is to fix some of them. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> --------- Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
1 parent 0a1178a commit 88336ff

File tree

81 files changed

+194
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+194
-194
lines changed

csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ IntPtr[] outputValues /* An array of output value pointers. Array must be alloca
13571357
OrtAllocatorType allocatorType,
13581358
int identifier,
13591359
OrtMemType memType,
1360-
out IntPtr /*(OrtMemoryInfo*)*/ allocatorInfo // memory ownership transfered to caller
1360+
out IntPtr /*(OrtMemoryInfo*)*/ allocatorInfo // memory ownership transferred to caller
13611361
);
13621362

13631363
public static DOrtCreateMemoryInfo OrtCreateMemoryInfo;

csharp/src/Microsoft.ML.OnnxRuntime/OrtValue.shared.cs

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -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>

csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/InferenceTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ public void TestSessionOptions()
116116

117117
var directml_dll_path = AppDomain.CurrentDomain.BaseDirectory;
118118
SetDllDirectory(directml_dll_path);
119-
119+
120120
try
121121
{
122122
opt.AppendExecutionProvider_DML(0);
123123
}
124124
catch (OnnxRuntimeException ortException)
125125
{
126126
// if we run on a CI machine with the incorrect hardware we might get an error due to that.
127-
// allow that as the call made it through to the DML EP so the C# layer is working correctly.
127+
// allow that as the call made it through to the DML EP so the C# layer is working correctly.
128128
// any other exception type or error message is considered a failure.
129129
Assert.Contains("The specified device interface or feature level is not supported on this system.",
130130
ortException.Message);
@@ -1895,7 +1895,7 @@ private void TestSharedAllocatorUsingCreateAndRegisterAllocator()
18951895
sessionOptions.AddSessionConfigEntry("session.use_env_allocators", "1");
18961896

18971897
// Create two sessions to share the allocator
1898-
// Create a thrid session that DOES NOT use the allocator in the environment
1898+
// Create a third session that DOES NOT use the allocator in the environment
18991899
using (var session1 = new InferenceSession(model, sessionOptions))
19001900
using (var session2 = new InferenceSession(model, sessionOptions))
19011901
using (var session3 = new InferenceSession(model)) // Use the default SessionOptions instance
@@ -2127,7 +2127,7 @@ private void TestLoadAzureEP()
21272127
}
21282128
catch (Exception) {
21292129
Assert.True(false);
2130-
}
2130+
}
21312131
}
21322132
}
21332133
}

csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class CommandOptions
3232
[Option('i', "input_file", Required = false, HelpText = "Input file.")]
3333
public string InputFile { get; set; }
3434

35-
[Option('p', Required = false, HelpText = "Run with parallel exection. Default is false")]
35+
[Option('p', Required = false, HelpText = "Run with parallel execution. Default is false")]
3636
public bool ParallelExecution { get; set; } = false;
3737

3838
[Option('o', "optimization_level", Required = false, HelpText = "Optimization Level. Default is 99, all optimization.")]

include/onnxruntime/core/eager/ort_kernel_invoker.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ class ORTInvoker {
2424
public:
2525
ORTInvoker(std::shared_ptr<IExecutionProvider> execution_provider,
2626
const logging::Logger& logger,
27-
const IOnnxRuntimeOpSchemaRegistryList& custom_op_registries) : execution_provider_(std::move(execution_provider)), logger_(logger), custom_op_registries_(custom_op_registries) {
27+
const IOnnxRuntimeOpSchemaRegistryList& custom_op_registries)
28+
: execution_provider_(std::move(execution_provider)),
29+
logger_(logger),
30+
custom_op_registries_(custom_op_registries) {
2831
if (!execution_provider_) {
2932
ORT_THROW("Execution provider is nullptr");
3033
}

include/onnxruntime/core/framework/execution_provider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class IExecutionProvider {
231231
const std::reference_wrapper<GraphViewer> filtered_graph;
232232
};
233233

234-
// Fusion approach that is suppported
234+
// Fusion approach that is supported
235235
// !!! The "Function" FusionStyle is deprecated.
236236
// !!! If your EP is using this fusion style, please migrate it to "FilteredGraphViewer" style.
237237
enum class FusionStyle {

include/onnxruntime/core/framework/op_kernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class OpKernel {
9494
}
9595

9696
// Override this function to return a list of attributes the session can safely remove
97-
// after it is intialized and saved. This option is useful to reduce memory usage
97+
// after it is initialized and saved. This option is useful to reduce memory usage
9898
// when the kernel does not reuse the operator attributes but copies them.
9999
// All attributes returned by this method will be removed by method
100100
// PruneRemovableAttributes of they exists.

include/onnxruntime/core/framework/stream_handles.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ class Stream {
5454
// update its lookup table with the table snapshot in notification.
5555
// The memory reusing strategy is:
5656
// A kernel in current stream is safe to reuse another stream's memory chunk
57-
// as long as the reused chunk's timestamp is less than the last synchonized
57+
// as long as the reused chunk's timestamp is less than the last synchronized
5858
// timestamp recorded in the lookup table.
5959

6060
// Get the current timestamp
6161
uint64_t GetCurrentTimestamp() const { return timestamp_; }
6262

6363
// return the timestamp when the last synchronization happened between target stream and current stream.
64-
// return 0 if no synchonization happened.
64+
// return 0 if no synchronization happened.
6565
// if target_stream is nullptr, it means it is a sequence running on device doesn't support Stream (i.e. CPU)
6666
// we can safely return 0 in that case to save a lookup.
6767
uint64_t GetLastSyncTimestampWithTargetStream(Stream* target_stream) const {

0 commit comments

Comments
 (0)