coreml-proto 0.1.0

CoreML protobuf definitions and decoders
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
// This file is @generated by prost-build.
/// The top level container.
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Program {
    #[prost(int64, tag = "1")]
    pub version: i64,
    /// Must be unique within the containing program
    /// Names must be valid identifiers as described above.
    #[prost(map = "string, message", tag = "2")]
    pub functions: ::std::collections::HashMap<::prost::alloc::string::String, Function>,
    #[prost(string, tag = "3")]
    pub doc_string: ::prost::alloc::string::String,
    /// Any other attributes not described by other fields.
    /// Keys must be valid identifiers as described above.
    #[prost(map = "string, message", tag = "4")]
    pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
/// A program-level function.
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Function {
    /// Function inputs are unordered (name, ValueType) pairs.
    /// Inputs intended to process images must be rank-4 Float32 tensors. Dimensions
    /// are interpreted as NCHW, with N == 1 and C being 1 for grayscale and 3 for RGB.
    /// Names must be valid identifiers as described above.
    #[prost(message, repeated, tag = "1")]
    pub inputs: ::prost::alloc::vec::Vec<NamedValueType>,
    /// The active block is drawn from this named specialization.
    /// This key must exist in `block_specializations`.
    #[prost(string, tag = "2")]
    pub opset: ::prost::alloc::string::String,
    /// Named specializations of this function.
    ///
    /// Specialization keys are the name of the opset that the
    /// function specialization is written in. They must be valid
    /// identifiers as described above.
    ///
    /// Outputs from all blocks must match. They define the outputs
    /// of the function.
    /// Each block inherits the lexical scope from the function.
    #[prost(map = "string, message", tag = "3")]
    pub block_specializations: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        Block,
    >,
    /// Any other attributes not described by other fields.
    /// Keys must be valid identifiers as described above.
    #[prost(map = "string, message", tag = "4")]
    pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
/// A basic block with a single entry and exit in SSA form.
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Block {
    /// Infrequently used, these are for operators that may need to give
    /// block-local names to input values (e.g. while_loop).
    #[prost(message, repeated, tag = "1")]
    pub inputs: ::prost::alloc::vec::Vec<NamedValueType>,
    /// The names to give to values returned by this block. They must be
    /// identifiers as described above.
    ///
    /// ValueType of outputs\[i\] is Operation\[j\].outputs\[k\].type where
    /// i, j and k are indices of block output, block Operation and
    /// jth operation's output respectively.
    /// this is due to
    /// 1. An operation can have more than one output
    /// 2. Any one of operation's output could be potentially block's output
    #[prost(string, repeated, tag = "2")]
    pub outputs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, repeated, tag = "3")]
    pub operations: ::prost::alloc::vec::Vec<Operation>,
    /// Any other attributes not described by other fields.
    /// Keys must be valid identifiers as described above.
    #[prost(map = "string, message", tag = "4")]
    pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
/// Argument is list of Binding to either name or value
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Argument {
    #[prost(message, repeated, tag = "1")]
    pub arguments: ::prost::alloc::vec::Vec<argument::Binding>,
}
/// Nested message and enum types in `Argument`.
pub mod argument {
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Binding {
        #[prost(oneof = "binding::Binding", tags = "1, 2")]
        pub binding: ::core::option::Option<binding::Binding>,
    }
    /// Nested message and enum types in `Binding`.
    pub mod binding {
        #[allow(clippy::all)]
        #[allow(clippy::pedantic)]
        #[allow(clippy::nursery)]
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum Binding {
            /// The name of a previously defined value.
            #[prost(string, tag = "1")]
            Name(::prost::alloc::string::String),
            /// A compile time constant.
            #[prost(message, tag = "2")]
            Value(super::super::Value),
        }
    }
}
/// A single operation/node/layer.
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Operation {
    /// Examples: "convolution", "cropResize". Operation type defines the
    /// expected inputs and output.
    #[prost(string, tag = "1")]
    pub r#type: ::prost::alloc::string::String,
    /// Operator arguments
    ///
    /// Key: parameter name
    /// Value: Argument (list of bindings)
    ///
    /// Value is list of argument binding to given parameter
    /// Binding can be a string name (previous operation output or input given to model/block/function)
    ///              or a Value (known compile time value for given operation)
    /// Argument can be of length 1 (general) or variable length (e.g. concat layer)
    /// e.g. {'stride' : \['input_01'\]}
    /// e.g. {'x' : \['input_01', 'input_02', 'input_03', false\]}
    #[prost(map = "string, message", tag = "2")]
    pub inputs: ::std::collections::HashMap<::prost::alloc::string::String, Argument>,
    /// Names to which to bind values returned by this operation.
    /// Names must be:
    ///   (*) valid identifiers as described above; and
    ///   (*) unique within the current scope.
    #[prost(message, repeated, tag = "3")]
    pub outputs: ::prost::alloc::vec::Vec<NamedValueType>,
    /// Nested blocks for loops and conditionals. For example,
    /// a conditional block will have two entries here.
    #[prost(message, repeated, tag = "4")]
    pub blocks: ::prost::alloc::vec::Vec<Block>,
    /// Any other information not captured by other fields.
    /// Keys must be valid identifiers as described above.
    #[prost(map = "string, message", tag = "5")]
    pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
/// Named Value parameters
/// (name, type) pair
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamedValueType {
    /// The name of this parameter; must be a valid identifier as described above.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// This parameter's required type.
    #[prost(message, optional, tag = "2")]
    pub r#type: ::core::option::Option<ValueType>,
}
/// A type of any kind
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValueType {
    #[prost(oneof = "value_type::Type", tags = "1, 2, 3, 4, 5")]
    pub r#type: ::core::option::Option<value_type::Type>,
}
/// Nested message and enum types in `ValueType`.
pub mod value_type {
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Type {
        #[prost(message, tag = "1")]
        TensorType(super::TensorType),
        #[prost(message, tag = "2")]
        ListType(::prost::alloc::boxed::Box<super::ListType>),
        #[prost(message, tag = "3")]
        TupleType(super::TupleType),
        #[prost(message, tag = "4")]
        DictionaryType(::prost::alloc::boxed::Box<super::DictionaryType>),
        #[prost(message, tag = "5")]
        StateType(::prost::alloc::boxed::Box<super::StateType>),
    }
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TensorType {
    /// The data type stored in a tensor of this type
    #[prost(enumeration = "DataType", tag = "1")]
    pub data_type: i32,
    /// The number of dimensions in the tensor shape. rank == -1 implies
    /// variable (not fixed) rank
    #[prost(int64, tag = "2")]
    pub rank: i64,
    /// Tensor shape values; must be of length "rank"
    #[prost(message, repeated, tag = "3")]
    pub dimensions: ::prost::alloc::vec::Vec<Dimension>,
    /// Any other tensor type attributes not described by other fields.
    /// Keys must be valid identifiers in MIL text syntax.
    #[prost(map = "string, message", tag = "4")]
    pub attributes: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TupleType {
    /// Recursively define TupleType from ValueType.
    #[prost(message, repeated, tag = "1")]
    pub types: ::prost::alloc::vec::Vec<ValueType>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListType {
    /// The type of element stored in a list of this type
    #[prost(message, optional, boxed, tag = "1")]
    pub r#type: ::core::option::Option<::prost::alloc::boxed::Box<ValueType>>,
    /// The number of elements in a list of this type. May be unknown (variable length)
    #[prost(message, optional, tag = "2")]
    pub length: ::core::option::Option<Dimension>,
}
/// An unordered key-value mapping
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DictionaryType {
    #[prost(message, optional, boxed, tag = "1")]
    pub key_type: ::core::option::Option<::prost::alloc::boxed::Box<ValueType>>,
    #[prost(message, optional, boxed, tag = "2")]
    pub value_type: ::core::option::Option<::prost::alloc::boxed::Box<ValueType>>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StateType {
    #[prost(message, optional, boxed, tag = "1")]
    pub wrapped_type: ::core::option::Option<::prost::alloc::boxed::Box<ValueType>>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Dimension {
    #[prost(oneof = "dimension::Dimension", tags = "1, 2")]
    pub dimension: ::core::option::Option<dimension::Dimension>,
}
/// Nested message and enum types in `Dimension`.
pub mod dimension {
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct ConstantDimension {
        #[prost(uint64, tag = "1")]
        pub size: u64,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct UnknownDimension {
        #[prost(bool, tag = "1")]
        pub variadic: bool,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Dimension {
        #[prost(message, tag = "1")]
        Constant(ConstantDimension),
        #[prost(message, tag = "2")]
        Unknown(UnknownDimension),
    }
}
/// See Variable vs Value primer above.
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Value {
    /// optional human-readable texts.
    #[prost(string, tag = "1")]
    pub doc_string: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub r#type: ::core::option::Option<ValueType>,
    #[prost(oneof = "value::Value", tags = "3, 5")]
    pub value: ::core::option::Option<value::Value>,
}
/// Nested message and enum types in `Value`.
pub mod value {
    /// An immediate value stored within the proto
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ImmediateValue {
        #[prost(oneof = "immediate_value::Value", tags = "1, 2, 3, 4")]
        pub value: ::core::option::Option<immediate_value::Value>,
    }
    /// Nested message and enum types in `ImmediateValue`.
    pub mod immediate_value {
        #[allow(clippy::all)]
        #[allow(clippy::pedantic)]
        #[allow(clippy::nursery)]
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum Value {
            #[prost(message, tag = "1")]
            Tensor(super::super::TensorValue),
            #[prost(message, tag = "2")]
            Tuple(super::super::TupleValue),
            #[prost(message, tag = "3")]
            List(super::super::ListValue),
            #[prost(message, tag = "4")]
            Dictionary(super::super::DictionaryValue),
        }
    }
    /// Reference to a "blob v2" storage file
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct BlobFileValue {
        /// name of file
        #[prost(string, tag = "1")]
        pub file_name: ::prost::alloc::string::String,
        /// byte offset to metadata
        #[prost(uint64, tag = "2")]
        pub offset: u64,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Value {
        #[prost(message, tag = "3")]
        ImmediateValue(ImmediateValue),
        #[prost(message, tag = "5")]
        BlobFileValue(BlobFileValue),
    }
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TensorValue {
    #[prost(oneof = "tensor_value::Value", tags = "1, 2, 3, 4, 5, 6, 7")]
    pub value: ::core::option::Option<tensor_value::Value>,
}
/// Nested message and enum types in `TensorValue`.
pub mod tensor_value {
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct RepeatedFloats {
        #[prost(float, repeated, tag = "1")]
        pub values: ::prost::alloc::vec::Vec<f32>,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct RepeatedDoubles {
        #[prost(double, repeated, tag = "1")]
        pub values: ::prost::alloc::vec::Vec<f64>,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct RepeatedInts {
        #[prost(int32, repeated, tag = "1")]
        pub values: ::prost::alloc::vec::Vec<i32>,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct RepeatedLongInts {
        #[prost(int64, repeated, tag = "1")]
        pub values: ::prost::alloc::vec::Vec<i64>,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct RepeatedBools {
        #[prost(bool, repeated, tag = "1")]
        pub values: ::prost::alloc::vec::Vec<bool>,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct RepeatedStrings {
        #[prost(string, repeated, tag = "1")]
        pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct RepeatedBytes {
        #[prost(bytes = "vec", tag = "1")]
        pub values: ::prost::alloc::vec::Vec<u8>,
    }
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Value {
        #[prost(message, tag = "1")]
        Floats(RepeatedFloats),
        #[prost(message, tag = "2")]
        Ints(RepeatedInts),
        #[prost(message, tag = "3")]
        Bools(RepeatedBools),
        #[prost(message, tag = "4")]
        Strings(RepeatedStrings),
        #[prost(message, tag = "5")]
        LongInts(RepeatedLongInts),
        #[prost(message, tag = "6")]
        Doubles(RepeatedDoubles),
        #[prost(message, tag = "7")]
        Bytes(RepeatedBytes),
    }
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TupleValue {
    /// Comment: TupleValue is recursively defined from Value.
    #[prost(message, repeated, tag = "1")]
    pub values: ::prost::alloc::vec::Vec<Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListValue {
    #[prost(message, repeated, tag = "1")]
    pub values: ::prost::alloc::vec::Vec<Value>,
}
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DictionaryValue {
    #[prost(message, repeated, tag = "1")]
    pub values: ::prost::alloc::vec::Vec<dictionary_value::KeyValuePair>,
}
/// Nested message and enum types in `DictionaryValue`.
pub mod dictionary_value {
    #[allow(clippy::all)]
    #[allow(clippy::pedantic)]
    #[allow(clippy::nursery)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct KeyValuePair {
        #[prost(message, optional, tag = "1")]
        pub key: ::core::option::Option<super::Value>,
        #[prost(message, optional, tag = "2")]
        pub value: ::core::option::Option<super::Value>,
    }
}
/// Supported data types
///
/// Comment: Two schemes of specifying field id: just start with 0
/// without reserving numbers, but keep track of the next field ID. The
/// other is assign blocks of ID to int / float / uint etc.
#[allow(clippy::all)]
#[allow(clippy::pedantic)]
#[allow(clippy::nursery)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DataType {
    /// 0-10 reserved for special types
    ///
    /// not currently in use
    UnusedType = 0,
    Bool = 1,
    /// arbitrary sequence of bytes
    String = 2,
    /// Floats
    Float8e4m3fn = 40,
    Float8e5m2 = 41,
    Float16 = 10,
    Float32 = 11,
    Float64 = 12,
    Bfloat16 = 13,
    /// Ints
    Int8 = 21,
    Int16 = 22,
    Int32 = 23,
    Int64 = 24,
    Int4 = 25,
    /// UInts
    Uint8 = 31,
    Uint16 = 32,
    Uint32 = 33,
    Uint64 = 34,
    Uint4 = 35,
    Uint2 = 36,
    Uint1 = 37,
    Uint6 = 38,
    Uint3 = 39,
}
impl DataType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::UnusedType => "UNUSED_TYPE",
            Self::Bool => "BOOL",
            Self::String => "STRING",
            Self::Float8e4m3fn => "FLOAT8E4M3FN",
            Self::Float8e5m2 => "FLOAT8E5M2",
            Self::Float16 => "FLOAT16",
            Self::Float32 => "FLOAT32",
            Self::Float64 => "FLOAT64",
            Self::Bfloat16 => "BFLOAT16",
            Self::Int8 => "INT8",
            Self::Int16 => "INT16",
            Self::Int32 => "INT32",
            Self::Int64 => "INT64",
            Self::Int4 => "INT4",
            Self::Uint8 => "UINT8",
            Self::Uint16 => "UINT16",
            Self::Uint32 => "UINT32",
            Self::Uint64 => "UINT64",
            Self::Uint4 => "UINT4",
            Self::Uint2 => "UINT2",
            Self::Uint1 => "UINT1",
            Self::Uint6 => "UINT6",
            Self::Uint3 => "UINT3",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UNUSED_TYPE" => Some(Self::UnusedType),
            "BOOL" => Some(Self::Bool),
            "STRING" => Some(Self::String),
            "FLOAT8E4M3FN" => Some(Self::Float8e4m3fn),
            "FLOAT8E5M2" => Some(Self::Float8e5m2),
            "FLOAT16" => Some(Self::Float16),
            "FLOAT32" => Some(Self::Float32),
            "FLOAT64" => Some(Self::Float64),
            "BFLOAT16" => Some(Self::Bfloat16),
            "INT8" => Some(Self::Int8),
            "INT16" => Some(Self::Int16),
            "INT32" => Some(Self::Int32),
            "INT64" => Some(Self::Int64),
            "INT4" => Some(Self::Int4),
            "UINT8" => Some(Self::Uint8),
            "UINT16" => Some(Self::Uint16),
            "UINT32" => Some(Self::Uint32),
            "UINT64" => Some(Self::Uint64),
            "UINT4" => Some(Self::Uint4),
            "UINT2" => Some(Self::Uint2),
            "UINT1" => Some(Self::Uint1),
            "UINT6" => Some(Self::Uint6),
            "UINT3" => Some(Self::Uint3),
            _ => None,
        }
    }
}