Skip to main content

coreml_proto/proto/
core_ml.specification.mil_spec.rs

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