An .mlmodel file is one Protocol
Buffers message, CoreML.Specification.Model, from
Model.proto
in Apple’s coremltools repository (with FeatureTypes.proto), read
2026-11-12. The number before each field is its field number.
Model
| Field | Name | Meaning |
|---|---|---|
| 1 | specificationVersion | The oldest Core ML that can run it; see versions. |
| 2 | description | ModelDescription. |
| 10 | isUpdatable | The model can be trained further on the device. |
| 200 and up | Type (oneof) | Exactly one model body, below. |
| Field | Model type | Field | Model type |
|---|---|---|---|
| 200 | pipelineClassifier | 555 | customModel |
| 201 | pipelineRegressor | 556 | linkedModel |
| 202 | pipeline | 560 | classConfidenceThresholding |
| 300 | glmRegressor | 600 | oneHotEncoder |
| 301 | supportVectorRegressor | 601 | imputer |
| 302 | treeEnsembleRegressor | 602 | featureVectorizer |
| 303 | neuralNetworkRegressor | 603 | dictVectorizer |
| 304 | bayesianProbitRegressor | 604 | scaler |
| 400 | glmClassifier | 606 | categoricalMapping |
| 401 | supportVectorClassifier | 607 | normalizer |
| 402 | treeEnsembleClassifier | 609 | arrayFeatureExtractor |
| 403 | neuralNetworkClassifier | 610 | nonMaximumSuppression |
| 404 | kNearestNeighborsClassifier | 900 | identity |
| 500 | neuralNetwork | 2000–2006 | textClassifier, wordTagger, visionFeaturePrint, soundAnalysisPreprocessing, gazetteer, wordEmbedding, audioFeaturePrint |
| 501 | itemSimilarityRecommender | 3000 | serializedModel |
| 502 | mlProgram |
ModelDescription and Metadata
| Field | Name | Meaning |
|---|---|---|
| 1 | input | Repeated FeatureDescription: 1 name, 2 shortDescription, 3 type (int64, double, string, image, multi-array, dictionary, sequence or state). |
| 10 | output | Repeated FeatureDescription. |
| 11 | predictedFeatureName | For classifiers: the output holding the class. |
| 12 | predictedProbabilitiesName | For classifiers: the output holding the probabilities. |
| 13 | state | Stateful models’ state features. |
| 20, 21 | functions, defaultFunctionName | Models with several functions. |
| 50 | trainingInput | Inputs for on-device training. |
| 100 | metadata | Metadata: 1 shortDescription, 2 versionString, 3 author, 4 license, 100 userDefined (string map). |
Specification versions
| Version | Core ML | iOS |
|---|---|---|
| 1 | 1 | 11 |
| 2 | 1.2 | 11.2 |
| 3 | 2 | 12 |
| 4 | 3 | 13 |
| 5 | 4 | 14 |
| 6 | 5 | 15 |
| 7 | 6 | 16 |
| 8 | 7 | 17 |
| 9 | 8 | 18 |
| 10 | 9 | 26 |
The matching macOS, tvOS, watchOS and visionOS releases are listed in
Model.proto. The ML Program model type (mlProgram) arrived
with specification version 6, and updatable models with version 4.
Feature types
From FeatureTypes.proto (coremltools main, read 2026-11-13).
FeatureType: oneof Type of 1 int64Type, 2
doubleType, 3 stringType, 4 imageType, 5
multiArrayType, 6 dictionaryType, 7 sequenceType,
8 stateType; and 1000 isOptional.
- ImageFeatureType: 1
width, 2height(int64), 3colorSpace(INVALID_COLOR_SPACE0,GRAYSCALE10,RGB20,BGR30,GRAYSCALE_FLOAT1640); size flexibility oneof: 21enumeratedSizes(a list of width and height pairs) or 31imageSizeRange(widthRange1,heightRange2, each aSizeRangeoflowerBounduint64 andupperBoundint64). - ArrayFeatureType: 1
shape(repeated int64), 2dataType(FLOAT3265568,DOUBLE65600,INT32131104,INT8131080,FLOAT1665552; 0 invalid); shape flexibility oneof: 21enumeratedShapesor 31shapeRange(a list ofSizeRange); default optional value oneof: 41intDefaultValue, 51floatDefaultValue, 61doubleDefaultValue. - DictionaryFeatureType: key type oneof 1
int64KeyTypeor 2stringKeyType. SequenceFeatureType: 1int64Typeor 3stringType, and 101sizeRange. StateFeatureType: 1arrayType.
The other model messages
Each is a message in its own .proto file of the same repository
(read 2026-11-13). Field numbers are given as name = number.
| Message (file) | Fields |
|---|---|
Pipeline, PipelineClassifier, PipelineRegressor (Model.proto) | Pipeline: models = 1 (repeated Model), names = 2 (repeated string). The classifier and regressor wrap one pipeline = 1. |
GLMRegressor | weights = 1 (repeated DoubleArray of value), offset = 2 (repeated double), postEvaluationTransform = 3 (NoTransform 0, Logit 1, Probit 2). |
GLMClassifier | weights = 1, offset = 2, postEvaluationTransform = 3 (Logit 0, Probit 1), classEncoding = 4 (ReferenceClass 0, OneVsRest 1), class labels oneof 100 stringClassLabels or 101 int64ClassLabels. |
TreeEnsembleParameters, TreeEnsembleClassifier, TreeEnsembleRegressor (TreeEnsemble.proto) | Parameters: nodes = 1 (repeated TreeNode), numPredictionDimensions = 2, basePredictionValue = 3 (repeated double). TreeNode: treeId = 1, nodeId = 2 (uint64), nodeBehavior = 3 (BranchOnValueLessThanEqual 0, LessThan 1, GreaterThanOrEqual 2, GreaterThan 3, Equal 4, NotEqual 5, LeafNode 6), branchFeatureIndex = 10 (uint64), branchFeatureValue = 11 (double), trueChildNodeId = 12, falseChildNodeId = 13, missingValueTracksTrueChild = 14 (bool), evaluationInfo = 20 (repeated evaluationIndex uint64 and evaluationValue double, added to the base prediction at a leaf), relativeHitRate = 30 (double). A tree has exactly one root, never ends on a branch, and every leaf is reachable. Classifier: treeEnsemble = 1, postEvaluationTransform = 2 (NoTransform 0, Classification_SoftMax 1, Regression_Logistic 2, Classification_SoftMaxWithZeroClassReference 3), labels oneof 100 string or 101 int64. Regressor: treeEnsemble = 1, postEvaluationTransform = 2. |
SupportVectorRegressor, SupportVectorClassifier (SVM.proto) | Kernels: LinearKernel (none), RBFKernel (gamma = 1), PolyKernel (degree = 1 int32, c = 2, gamma = 3), SigmoidKernel (gamma = 1, c = 2); Kernel oneof 1–4. Support vectors sparse (SparseNode: index = 1 int32, value = 2) or dense (DenseVector: values = 1). Regressor: kernel = 1, support vectors 2 (sparse) or 3 (dense), coefficients = 4 (alpha), rho = 5. Classifier: kernel = 1, numberOfSupportVectorsPerClass = 2, vectors 3 or 4, coefficients = 5 (repeated), rho = 6, probA = 7, probB = 8, labels 100 or 101. |
Scaler | shiftValue = 1, scaleValue = 2 (repeated double): f(x) = scale × (x + shift); defaults scale 1 and shift 0; a single value applies to every array element; integer input is converted to double, and a lossy cast to an integer output is an error. |
Normalizer | normType = 1: LMax 0 (max), L1 1 (sum of absolute values), L2 2 (Euclidean norm). |
OneHotEncoder | Categories oneof 1 stringCategories or 2 int64Categories (the position gives the index of the one); outputSparse = 10; handleUnknown = 11 (ErrorOnUnknown 0, IgnoreUnknown 1). |
Imputer | Imputed value oneof 1 double, 2 int64, 3 string, 4 double array, 5 int64 array, 6 string-to-double map, 7 int64-to-double map; replace value oneof 11 double, 12 int64, 13 string (a missing value of that kind is replaced). |
FeatureVectorizer | inputList = 1: repeated InputColumn (inputColumn = 1 string, inputDimensions = 2 uint64); output order follows the list. |
ArrayFeatureExtractor | extractIndex = 1 (repeated uint64, zero-based). |
CategoricalMapping | Mapping oneof 1 stringToInt64Map or 2 int64ToStringMap; value on unknown oneof 101 strValue or 102 int64Value (absent means an unknown input is an error). |
DictVectorizer | oneof 1 stringToIndex or 2 int64ToIndex: the output array has one slot per key in order; a key absent from the input dictionary gives 0 (["a","c","b","z"] turns {"a":4,"c":8} into [4,8,0,0]). |
Identity | No fields; returns its inputs unchanged, for testing. |
ClassConfidenceThresholding | precisionRecallCurves = 100 (one per class label, optional). Input a multi-array of shape [C]; output shape [2, C]: row 0 the confidences, row 1 the presence flags (currently all 1). |
LinkedModel | oneof 1 linkedModelFile: linkedModelFileName = 1 and linkedModelSearchPath = 2, both StringParameter. |
CustomModel | className = 10, parameters = 30 (map of string to a value oneof 10 double, 20 string, 30 int32, 40 int64, 50 bool, 60 bytes), description = 40. |
The remaining model messages (kNearestNeighborsClassifier, BayesianProbitRegressor, ItemSimilarityRecommender, NonMaximumSuppression, textClassifier, wordTagger, gazetteer, wordEmbedding, visionFeaturePrint, soundAnalysisPreprocessing, audioFeaturePrint, serializedModel) are laid out in their own section below.
NeuralNetwork layers
From NeuralNetwork.proto (read 2026-11-13). The file is about 6,500
lines; this section gives the layer type of every number in
NeuralNetworkLayer's oneof layer; each type's parameters are the
fields of the message …LayerParams of that name in the file
(for example ConvolutionLayerParams), whose fields are listed in the
next section.
100 convolution, 120 pooling, 130 activation, 140 innerProduct, 150 embedding, 160 batchnorm, 165 mvn, 170 l2normalize, 175 softmax, 180 lrn, 190 crop, 200 padding, 210 upsample, 211 resizeBilinear, 212 cropResize, 220 unary, 230 add, 231 multiply, 240 average, 245 scale, 250 bias, 260 max, 261 min, 270 dot, 280 reduce, 290 loadConstant, 300 reshape, 301 flatten, 310 permute, 320 concat, 330 split, 340 sequenceRepeat, 345 reorganizeData, 350 slice, 400 simpleRecurrent, 410 gru, 420 uniDirectionalLSTM, 430 biDirectionalLSTM, 500 custom, 600 copy, 605 branch, 615 loop, 620 loopBreak, 625 loopContinue, 635 rangeStatic, 640 rangeDynamic, 660 clip, 665 ceil, 670 floor, 680 sign, 685 round, 700 exp2, 710 sin, 715 cos, 720 tan, 730 asin, 735 acos, 740 atan, 750 sinh, 755 cosh, 760 tanh, 770 asinh, 775 acosh, 780 atanh, 790 erf, 795 gelu, 815 equal, 820 notEqual, 825 lessThan, 827 lessEqual, 830 greaterThan, 832 greaterEqual, 840 logicalOr, 845 logicalXor, 850 logicalNot, 855 logicalAnd, 865 modBroadcastable, 870 minBroadcastable, 875 maxBroadcastable, 880 addBroadcastable, 885 powBroadcastable, 890 divideBroadcastable, 895 floorDivBroadcastable, 900 multiplyBroadcastable, 905 subtractBroadcastable, 920 tile, 925 stack, 930 gather, 935 scatter, 940 gatherND, 945 scatterND, 950 softmaxND, 952 gatherAlongAxis, 954 scatterAlongAxis, 960 reverse, 965 reverseSeq, 975 splitND, 980 concatND, 985 transpose, 995 sliceStatic, 1000 sliceDynamic, 1005 slidingWindows, 1015 topK, 1020 argMin, 1025 argMax, 1040 embeddingND, 1045 batchedMatmul, 1065 getShape, 1070 loadConstantND, 1080 fillLike, 1085 fillStatic, 1090 fillDynamic, 1100 broadcastToLike, 1105 broadcastToStatic, 1110 broadcastToDynamic, 1120 squeeze, 1125 expandDims, 1130 flattenTo2D, 1135 reshapeLike, 1140 reshapeStatic, 1145 reshapeDynamic, 1150 rankPreservingReshape, 1155 constantPad, 1170 randomNormalLike, 1175 randomNormalStatic, 1180 randomNormalDynamic, 1190 randomUniformLike, 1195 randomUniformStatic, 1200 randomUniformDynamic, 1210 randomBernoulliLike, 1215 randomBernoulliStatic, 1220 randomBernoulliDynamic, 1230 categoricalDistribution, 1250 reduceL1, 1255 reduceL2, 1260 reduceMax, 1265 reduceMin, 1270 reduceSum, 1275 reduceProd, 1280 reduceMean, 1285 reduceLogSum, 1290 reduceSumSquare, 1295 reduceLogSumExp, 1313 whereNonZero, 1315 matrixBandPart, 1320 lowerTriangular, 1325 upperTriangular, 1330 whereBroadcastable, 1350 layerNormalization, 1400 NonMaximumSuppression, 1450 oneHot, 1455 cumSum, 1460 clampedReLU, 1461 argSort, 1465 pooling3d, 1466 globalPooling3d, 1470 sliceBySize, 1471 convolution3d.
Layer parameter messages
Every message of NeuralNetwork.proto (apple/coremltools, main branch, read
2026-11-13), as name = number with the proto type; [] marks
repeated. The proto's comments hold the semantics (shapes, rounding,
examples); only the rules that fit a line are quoted here. A message listed with no fields
has none in the file. A field number missing from a message (for example field 1 of
GreaterThanLayerParams) is simply not in the file's definition.
Network, preprocessing and layer envelope
| Message | Fields |
|---|---|
NeuralNetwork | layers = 1 [NeuralNetworkLayer], preprocessing = 2 [NeuralNetworkPreprocessing], arrayInputShapeMapping = 5 (NeuralNetworkMultiArrayShapeMapping: 0 RANK5_ARRAY_MAPPING, 1 EXACT_ARRAY_MAPPING), imageInputShapeMapping = 6 (NeuralNetworkImageShapeMapping: 0 RANK5_IMAGE_MAPPING, 1 RANK4_IMAGE_MAPPING), updateParams = 10 (NetworkUpdateParameters). NeuralNetworkClassifier has the same fields 1, 2, 5, 6, 10 plus oneof ClassLabels 100 stringClassLabels or 101 int64ClassLabels and labelProbabilityLayerName = 200. NeuralNetworkRegressor has 1, 2, 5, 6, 10. |
NeuralNetworkLayer | name = 1, input = 2 [string], output = 3 [string], inputTensor = 4 [Tensor] (same length as input), outputTensor = 5 [Tensor], isUpdatable = 10 (bool), then oneof layer (numbers above). Tensor: rank = 1 (uint32), dimValue = 2 [int64]. |
NeuralNetworkPreprocessing | featureName = 1 (must equal the input name it applies to), oneof preprocessor: scaler = 10 (NeuralNetworkImageScaler: channelScale = 10, blueBias = 20, greenBias = 21, redBias = 22, grayBias = 30, all float) or meanImage = 11 (NeuralNetworkMeanImage: meanImage = 1 [float]). |
NetworkUpdateParameters | lossLayers = 1 [LossLayer], optimizer = 2 (Optimizer), epochs = 3 (Int64Parameter), shuffle = 10 (BoolParameter), seed = 20 (Int64Parameter). LossLayer: name = 1, oneof 10 categoricalCrossEntropyLossLayer or 11 meanSquaredErrorLossLayer (each: input = 1, target = 2, strings). Optimizer: oneof 10 sgdOptimizer (learningRate = 1 DoubleParameter, miniBatchSize = 2 Int64Parameter, momentum = 3 DoubleParameter) or 11 adamOptimizer (learningRate = 1, miniBatchSize = 2, beta1 = 3, beta2 = 4, eps = 5). The parameter messages are in Parameters.proto: Int64Parameter (defaultValue = 1, oneof 10 range (Int64Range) or 11 set (Int64Set)), DoubleParameter (defaultValue = 1, 10 range DoubleRange), StringParameter and BoolParameter (defaultValue = 1); a value is unbounded when no allowed values are given. |
Weights, quantisation, padding and shared messages
| Message | Fields |
|---|---|
WeightParams | Row-major data of 1 to 4 dimensions. floatValue = 1 [float] (FP32); float16Value = 2 (bytes, half precision); rawValue = 30 (bytes, read as uintN where N is the number of quantisation bits; use for quantised parameters unless int8RawValue is called for); int8RawValue = 31 (bytes read as INT8, used when the parent layer has int8DynamicQuantize; not with rawValue; requires linear quantisation with one scale and no bias); quantization = 40 (QuantizationParams); isUpdatable = 50. |
QuantizationParams | numberOfBits = 1 (uint64), oneof 101 linearQuantization (scale = 1 [float], bias = 2 [float]: 1 element or C elements, C being the output channels (the output vector size for recurrent layers); W_unquantised = W_quantised × scale + bias) or 102 lookupTableQuantization (floatValue = 1 [float], 2^numberOfBits entries). |
BorderAmounts | borderAmounts = 10 [EdgeSizes], each startEdgeSize = 1 and endEdgeSize = 2 (uint64). |
ValidPadding, SamePadding | Valid: paddingAmounts = 1 (BorderAmounts). Same: asymmetryMode = 1 (0 BOTTOM_RIGHT_HEAVY, 1 TOP_LEFT_HEAVY). |
SamplingMode | samplingMethod = 1: 0 STRICT_ALIGN_ENDPOINTS_MODE, 1 ALIGN_ENDPOINTS_MODE, 2 UPSAMPLE_MODE, 3 ROI_ALIGN_MODE. |
BoxCoordinatesMode | boxMode = 1: 0 CORNERS_HEIGHT_FIRST, 1 CORNERS_WIDTH_FIRST, 2 CENTER_SIZE_HEIGHT_FIRST, 3 CENTER_SIZE_WIDTH_FIRST. |
ActivationParams | oneof NonlinearityType: 5 linear (alpha = 1, beta = 2), 10 ReLU, 15 leakyReLU (alpha = 1), 20 thresholdedReLU (alpha = 1), 25 PReLU (alpha = 1 WeightParams), 30 tanh, 31 scaledTanh (alpha = 1, beta = 2), 40 sigmoid, 41 sigmoidHard (alpha = 1, beta = 2), 50 ELU (alpha = 1), 60 softsign, 70 softplus, 71 parametricSoftplus (alpha = 1, beta = 2, WeightParams of length C or 1). Unlisted parameters are floats; ReLU, tanh, sigmoid, softsign and softplus have no fields. |
Convolution, pooling, normalisation and linear layers
| Message | Fields |
|---|---|
ConvolutionLayerParams | outputChannels = 1, kernelChannels = 2, nGroups = 10, kernelSize = 20 [uint64], stride = 30 [uint64], dilationFactor = 40 [uint64], oneof ConvolutionPaddingType 50 valid / 51 same, isDeconvolution = 60, hasBias = 70, weights = 90 (WeightParams), bias = 91 (size outputChannels), outputShape = 100 [uint64]. Rank 4 input is [batch, channels, height, width]; from specification version 4 the layer may take a second input as the weights ([outputChannels, kernelChannels, kernelHeight, kernelWidth], kernelChannels = inputChannels / nGroups) when not a deconvolution. With dilation the effective kernel size is (kernelSize − 1) × dilationFactor + 1. For a deconvolution the padding type is ignored when outputShape is set. |
Convolution3DLayerParams | int32 fields: outputChannels = 1, inputChannels = 2, nGroups = 10, kernelDepth = 20, kernelHeight = 21, kernelWidth = 22, strideDepth = 31, strideHeight = 32, strideWidth = 33, dilationDepth = 40, dilationHeight = 41, dilationWidth = 42; hasBias = 50, weights = 60, bias = 61, paddingType = 70 (0 CUSTOM, 1 VALID, 2 SAME), customPaddingFront = 80, customPaddingBack = 81, customPaddingTop = 82, customPaddingBottom = 83, customPaddingLeft = 84, customPaddingRight = 85, isDeconvolution = 86, outputShape = 87 [uint64]. |
InnerProductLayerParams | inputChannels = 1, outputChannels = 2 (uint64), hasBias = 10, weights = 20 ([C_out, C_in]), bias = 21 ([C_out]), int8DynamicQuantize = 22. |
EmbeddingLayerParams, EmbeddingNDLayerParams | Embedding: inputDim = 1, outputChannels = 2, hasBias = 10, weights = 20 ([outputChannels, inputDim]), bias = 21. EmbeddingND: vocabSize = 1, embeddingSize = 2, hasBias = 3, weights = 20 ([embeddingSize, vocabSize]), bias = 21. |
BatchnormLayerParams | channels = 1, computeMeanVar = 5, instanceNormalization = 6, epsilon = 10 (float), gamma = 15, beta = 16, mean = 17, variance = 18 (each WeightParams of length channels). |
PoolingLayerParams | type = 1 (0 MAX, 1 AVERAGE, 2 L2), kernelSize = 10 [uint64], stride = 20 [uint64], oneof PoolingPaddingType 30 valid, 31 same, 32 includeLastPixel (ValidCompletePadding: paddingAmounts = 10 [uint64]), avgPoolExcludePadding = 50, globalPooling = 60. |
Pooling3DLayerParams, GlobalPooling3DLayerParams | Pooling3D: type = 1 (0 MAX, 1 AVERAGE), kernelDepth = 2, kernelHeight = 3, kernelWidth = 4, strideDepth = 5, strideHeight = 6, strideWidth = 7, paddingType = 15 (0 CUSTOM, 1 VALID, 2 SAME), customPaddingFront = 8, Back = 9, Top = 10, Bottom = 11, Left = 12, Right = 13, countExcludePadding = 14 (all int32 except the bool and enums). Global: type = 1 (0 MAX, 1 AVERAGE). |
MeanVarianceNormalizeLayerParams, L2NormalizeLayerParams, LRNLayerParams, LayerNormalizationLayerParams | MVN: acrossChannels = 1, normalizeVariance = 2, epsilon = 3. L2: epsilon = 1. LRN: alpha = 1, beta = 2, localSize = 3 (uint64), k = 4 (1 if 0; strictly positive). LayerNorm: normalizedShape = 1 [int64], eps = 2, gamma = 3, beta = 4 (WeightParams). |
SoftmaxLayerParams, SoftmaxNDLayerParams | Softmax: none. SoftmaxND: axis = 1 (int64). |
BatchedMatMulLayerParams | transposeA = 1, transposeB = 2, weightMatrixFirstDimension = 5 (X1, the last dimension of the input), weightMatrixSecondDimension = 6 (X2, the last dimension of the output), hasBias = 7 (one input only), weights = 8, bias = 9 ([X2]), int8DynamicQuantize = 10. |
UpsampleLayerParams, ResizeBilinearLayerParams, CropResizeLayerParams | Upsample: scalingFactor = 1 [uint64], fractionalScalingFactor = 7 [float], mode = 5 (0 NN, 1 BILINEAR), linearUpsampleMode = 6 (0 DEFAULT, 1 ALIGN_CORNERS_TRUE, 2 ALIGN_CORNERS_FALSE). ResizeBilinear: targetSize = 1 [uint64], mode = 2 (SamplingMode). CropResize: targetSize = 1, normalizedCoordinates = 2, mode = 3 (SamplingMode), boxIndicesMode = 4 (BoxCoordinatesMode), spatialScale = 5 (float). |
CropLayerParams, PaddingLayerParams, ConstantPaddingLayerParams | Crop: cropAmounts = 1 (BorderAmounts), offset = 5 [uint64]. Padding: oneof PaddingType 1 constant (value = 1 float), 2 reflection, 3 replication; paddingAmounts = 10 (BorderAmounts). ConstantPadding: value = 1, padAmounts = 2 [uint64], padToGivenOutputSizeMode = 3. |
Element-wise, comparison and math layers
| Message | Fields |
|---|---|
AddLayerParams, MultiplyLayerParams | alpha = 1 (float) in each (the scalar added or multiplied when there is one input). |
UnaryFunctionLayerParams | type = 1 (0 SQRT, 1 RSQRT, 2 INVERSE, 3 POWER, 4 EXP, 5 LOG, 6 ABS, 7 THRESHOLD), alpha = 2, epsilon = 3, shift = 4, scale = 5 (floats). |
BiasLayerParams, ScaleLayerParams, LoadConstantLayerParams, LoadConstantNDLayerParams | Bias: shape = 1 [uint64], bias = 2. Scale: shapeScale = 1 [uint64], scale = 2 (size equals the product of shapeScale), hasBias = 3, shapeBias = 4 [uint64], bias = 5. LoadConstant: shape = 1 [uint64], data = 2. LoadConstantND: shape = 1 [uint64], data = 2. |
AverageLayerParams, MaxLayerParams, MinLayerParams, CopyLayerParams, LoopBreakLayerParams, LoopContinueLayerParams, LogicalAndLayerParams, LogicalOrLayerParams, LogicalXorLayerParams, LogicalNotLayerParams | No fields. |
DotProductLayerParams | cosineSimilarity = 1. |
| Comparison layers | GreaterThanLayerParams, GreaterEqualLayerParams, LessThanLayerParams, LessEqualLayerParams: alpha = 2 (float, compared against when there is one input). EqualLayerParams, NotEqualLayerParams: alpha = 1. |
| No-field math layers | SinLayerParams, CosLayerParams, TanLayerParams, AsinLayerParams, AcosLayerParams, AtanLayerParams, SinhLayerParams, CoshLayerParams, TanhLayerParams, AsinhLayerParams, AcoshLayerParams, AtanhLayerParams, Exp2LayerParams, ErfLayerParams, CeilLayerParams, FloorLayerParams, RoundLayerParams, SignLayerParams, WhereNonZeroLayerParams, WhereBroadcastableLayerParams, GetShapeLayerParams, and the broadcastable binary layers AddBroadcastableLayerParams, MaxBroadcastableLayerParams, MinBroadcastableLayerParams, ModBroadcastableLayerParams, FloorDivBroadcastableLayerParams, SubtractBroadcastableLayerParams, MultiplyBroadcastableLayerParams, DivideBroadcastableLayerParams, PowBroadcastableLayerParams. |
ClipLayerParams, ClampedReLULayerParams, GeluLayerParams | Clip: minVal = 1, maxVal = 2. ClampedReLU: alpha = 1, beta = 2. Gelu: mode = 1 (0 EXACT, 1 TANH_APPROXIMATION, 2 SIGMOID_APPROXIMATION). |
ReduceLayerParams | mode = 1 (0 SUM, 1 AVG, 2 PROD, 3 LOGSUM, 4 SUMSQUARE, 5 L1, 6 L2, 7 MAX, 8 MIN, 9 ARGMAX; ARGMAX only with axis C, H or W), epsilon = 2, axis = 3 (0 CHW, 1 HW, 2 C, 3 H, 4 W). |
ReduceL1LayerParams, ReduceL2…, ReduceMax…, ReduceMin…, ReduceSum…, ReduceProd…, ReduceMean…, ReduceLogSum…, ReduceSumSquare…, ReduceLogSumExp… | Identical fields: axes = 1 [int64], keepDims = 2, reduceAll = 3. |
CumSumLayerParams, ArgMaxLayerParams, ArgMinLayerParams, ArgSortLayerParams, TopKLayerParams | CumSum: axis = 1, excludeFinalSum = 2, reverse = 3. ArgMax and ArgMin: axis = 1, removeDim = 2. ArgSort: axis = 1 (0 to rank − 1), descending = 2. TopK: axis = 1 (negative allowed), K = 2 (uint64; ignored if a second input is present), useBottomK = 3. |
NonMaximumSuppressionLayerParams | iouThreshold = 1, scoreThreshold = 2 (floats), maxBoxes = 3 (uint64), perClassSuppression = 4. |
OneHotLayerParams | oneHotVectorSize = 1 (uint64), axis = 2 (negative indexing, in the output tensor), onValue = 3, offValue = 4. |
| Random layers | RandomNormalLike / Static / Dynamic: seed = 1 (int64), mean = 2, stdDev = 3; Static adds outputShape = 4 [uint64]. RandomUniformLike / Static / Dynamic: seed = 1, minVal = 2, maxVal = 3; Static adds outputShape = 4. RandomBernoulliLike / Dynamic: seed = 1, prob = 2; Static adds outputShape = 3. CategoricalDistribution: seed = 1, numSamples = 2, isLogits = 3, eps = 4, temperature = 5. |
FillLikeLayerParams, FillStaticLayerParams, FillDynamicLayerParams, RangeStaticLayerParams, RangeDynamicLayerParams | FillLike and FillDynamic: value = 1; FillStatic: value = 1, targetShape = 2 [uint64]. RangeStatic: endValue = 1, startValue = 2, stepSizeValue = 3. RangeDynamic: startValue = 2, stepSizeValue = 3. |
MatrixBandPartLayerParams, UpperTriangularLayerParams, LowerTriangularLayerParams | BandPart: numLower = 1, numUpper = 2 (int64). Upper and Lower: k = 1 (int64; 0 the main diagonal, below it for k < 0, above for k > 0). |
Shape, indexing and sequence layers
| Message | Fields |
|---|---|
ReshapeLayerParams, FlattenLayerParams, PermuteLayerParams, ReorganizeDataLayerParams, SliceLayerParams | Reshape: targetShape = 1 [int64], mode = 2 (0 CHANNEL_FIRST, 1 CHANNEL_LAST). Flatten: mode = 1 (same values). Permute: axis = 1 [uint64]. ReorganizeData: mode = 1 (0 SPACE_TO_DEPTH, 1 DEPTH_TO_SPACE, 2 PIXEL_SHUFFLE), blockSize = 2 (greater than 1). Slice: startIndex = 1 (inclusive), endIndex = 2 (exclusive; int64), stride = 3 (positive), axis = 4 (0 CHANNEL_AXIS, 1 HEIGHT_AXIS, 2 WIDTH_AXIS). |
ConcatLayerParams, SplitLayerParams, SequenceRepeatLayerParams, ConcatNDLayerParams, SplitNDLayerParams, StackLayerParams, TileLayerParams | Concat: sequenceConcat = 100. Split: nOutputs = 1 (uint64). SequenceRepeat: nRepetitions = 1 (uint64). ConcatND: axis = 1, interleave = 2. SplitND: axis = 1, numSplits = 2 (uint64), splitSizes = 3 [uint64]. Stack: axis = 1. Tile: reps = 1 [uint64]. |
TransposeLayerParams, ReverseLayerParams, ReverseSeqLayerParams, SlidingWindowsLayerParams | Transpose: axes = 1 [uint64]. Reverse: reverseDim = 1 [bool]. ReverseSeq: batchAxis = 1 (strictly less than the sequence axis), sequenceAxis = 2. SlidingWindows: axis = 1, windowSize = 2 (uint64), step = 3 (uint64). |
SliceStaticLayerParams, SliceDynamicLayerParams, SliceBySizeLayerParams | SliceStatic: beginIds = 1 [int64], beginMasks = 2 [bool], endIds = 3 [int64], endMasks = 4 [bool], strides = 5 [int64], squeezeMasks = 6 [bool]. SliceDynamic: beginMasks = 2, endIds = 3, endMasks = 4, strides = 5, squeezeMasks = 6. SliceBySize: size = 2, axis = 3 (int64). |
SqueezeLayerParams, ExpandDimsLayerParams, FlattenTo2DLayerParams, ReshapeStaticLayerParams, RankPreservingReshapeLayerParams, BroadcastToStaticLayerParams | Squeeze: axes = 1 [int64], squeezeAll = 2. ExpandDims: axes = 1 [int64]. FlattenTo2D: axis = 1. ReshapeStatic and RankPreservingReshape: targetShape = 1 [int64]. BroadcastToStatic: targetShape = 1 [uint64]. ReshapeLikeLayerParams, ReshapeDynamicLayerParams, BroadcastToLikeLayerParams, BroadcastToDynamicLayerParams: none. |
GatherLayerParams, ScatterLayerParams, GatherNDLayerParams, ScatterNDLayerParams, GatherAlongAxisLayerParams, ScatterAlongAxisLayerParams | Gather: axis = 1. Scatter: axis = 1, mode = 2. GatherND: none. ScatterND: mode = 1. GatherAlongAxis: axis = 1. ScatterAlongAxis: axis = 1, mode = 2. ScatterMode: 0 SCATTER_UPDATE, 1 SCATTER_ADD, 2 SCATTER_SUB, 3 SCATTER_MUL, 4 SCATTER_DIV, 5 SCATTER_MAX, 6 SCATTER_MIN. |
| Control flow | BranchLayerParams: ifBranch = 1, elseBranch = 2 (each a nested NeuralNetwork). LoopLayerParams: maxLoopIterations = 1 (uint64), conditionVar = 2 (string), conditionNetwork = 3, bodyNetwork = 4 (NeuralNetwork). |
| Recurrent | SimpleRecurrentLayerParams: inputVectorSize = 1, outputVectorSize = 2 (uint64), activation = 10 (ActivationParams), sequenceOutput = 15, hasBiasVector = 20, weightMatrix = 30, recursionMatrix = 31, biasVector = 32, reverseInput = 100. GRULayerParams: inputVectorSize = 1, outputVectorSize = 2, activations = 10 [ActivationParams], sequenceOutput = 15, hasBiasVectors = 20, updateGateWeightMatrix = 30 (W_z), resetGateWeightMatrix = 31 (W_r), outputGateWeightMatrix = 32 (W_o), recursion matrices updateGateRecursionMatrix = 50, resetGateRecursionMatrix = 51, outputGateRecursionMatrix = 52 (R_z, R_r, R_o), bias vectors updateGateBiasVector = 70, resetGateBiasVector = 71, outputGateBiasVector = 72, reverseInput = 100. LSTMParams: sequenceOutput = 10, hasBiasVectors = 20, forgetBias = 30, hasPeepholeVectors = 40, coupledInputAndForgetGate = 50, cellClipThreshold = 60 (float). LSTMWeightParams (all WeightParams): inputGateWeightMatrix = 1, forgetGateWeightMatrix = 2, blockInputWeightMatrix = 3, outputGateWeightMatrix = 4; recursion matrices 20 to 23 (input, forget, block input, output); bias vectors 40 to 43; peephole vectors inputGatePeepholeVector = 60, forgetGatePeepholeVector = 61, outputGatePeepholeVector = 62. UniDirectionalLSTMLayerParams: inputVectorSize = 1, outputVectorSize = 2, activations = 10 [ActivationParams], params = 15 (LSTMParams), weightParams = 20, reverseInput = 100. BiDirectionalLSTMLayerParams: inputVectorSize = 1, outputVectorSize = 2, activationsForwardLSTM = 10 [ActivationParams], activationsBackwardLSTM = 11, params = 15, weightParams = 20 [LSTMWeightParams] (forward then backward). |
CustomLayerParams | className = 10 (a class conforming to MLCustomLayer), weights = 20 [WeightParams], parameters = 30 (map string to CustomLayerParamValue, oneof 10 doubleValue, 20 stringValue, 30 intValue, 40 longValue, 50 boolValue), description = 40 (shown when viewing the model, no effect on execution). |
Remaining standalone model messages
From the proto files named, apple/coremltools main branch (read 2026-11-13). Text-model
messages (TextClassifier, WordTagger, Gazetteer, WordEmbedding) keep their learned parameters
in an opaque modelParameterData bytes field whose layout the proto does not give
(it is produced by Apple's Natural Language framework).
Message (field in Model) | Fields |
|---|---|
BayesianProbitRegressor (304) | numberOfFeatures = 1 (uint32), bias = 2 (Gaussian: mean = 1, precision = 2 = 1/variance, doubles), features = 3 [FeatureWeight: featureId = 1 (uint32), weights = 2 [FeatureValueWeight: featureValue = 1 (uint32), featureWeight = 2 (Gaussian)]], names of the input features regressionInputFeatureName = 10 (1-D multi-array), optimismInputFeatureName = 11, samplingScaleInputFeatureName = 12, samplingTruncationInputFeatureName = 13 (optional doubles) and of the outputs meanOutputFeatureName = 20, varianceOutputFeatureName = 21, pessimisticProbabilityOutputFeatureName = 22, sampledProbabilityOutputFeatureName = 23. The model is P(y = +1 | x, w) = Φ(<w, x> / β) with Gaussian weights; features are discrete values. |
KNearestNeighborsClassifier (404) | nearestNeighborsIndex = 1, numberOfNeighbors = 3 (Int64Parameter), oneof ClassLabels 100 stringClassLabels / 101 int64ClassLabels, oneof DefaultClassLabel 110 defaultStringLabel / 111 defaultInt64Label (for an empty classifier), oneof WeightingScheme 200 uniformWeighting / 210 inverseDistanceWeighting (the neighbour with the highest sum of 1/distance wins). NearestNeighborsIndex: numberOfDimensions = 1 (int32), floatSamples = 2 [FloatVector], oneof IndexType 100 linearIndex (brute force) / 110 singleKdTreeIndex (leafSize = 1, int32), oneof DistanceFunction 200 squaredEuclideanDistance (the only one). |
ItemSimilarityRecommender (501) | itemItemSimilarities = 1 [SimilarItems: itemId = 1 (uint64), similarItemList = 2 [ConnectedItem: itemId = 1, similarityScore = 2 double], itemScoreAdjustment = 3 (double)]], itemStringIds = 2 or itemInt64Ids = 3 (length exactly the item count; with neither, the items are numbered 0 to n − 1), input names itemInputFeatureName = 10 (required), numRecommendationsInputFeatureName = 11 (optional, default all items), itemRestrictionInputFeatureName = 12, itemExclusionInputFeatureName = 13 (default: the input items), output names recommendedItemListOutputFeatureName = 20, recommendedItemScoreOutputFeatureName = 21 (at least one). Score of item k = sum over observed items i of sim(k, i) × (score_i − shift_k). |
NonMaximumSuppression (610) | oneof SuppressionMethod 1 pickTop (perClass = 1: suppress only among the same label), oneof ClassLabels 100 / 101, iouThreshold = 110, confidenceThreshold = 111 (doubles; boxes below the threshold are dropped first; non-negative), confidenceInputFeatureName = 200 (N × C multi-array of doubles), coordinatesInputFeatureName = 201 (N × 4: centre x, centre y, width, height), iouThresholdInputFeatureName = 202, confidenceThresholdInputFeatureName = 203 (optional scalar overrides at run time), confidenceOutputFeatureName = 210, coordinatesOutputFeatureName = 211. PickTop: sort by confidence, keep the top, discard all boxes within the IOU radius, repeat. Output shape may be fixed or a min/max range; unused rows are zero-filled. |
TextClassifier (2000) | revision = 1 (uint32; revision 1 is iOS and tvOS 12.0, macOS 10.14), language = 10 (BCP-47, e.g. en-US), modelParameterData = 100 (bytes), oneof ClassLabels 200 stringClassLabels. |
WordTagger (2001) | revision = 1, language = 10, tokensOutputFeatureName = 20, tokenTagsOutputFeatureName = 21, tokenLocationsOutputFeatureName = 22 (indices from 0), tokenLengthsOutputFeatureName = 23, modelParameterData = 100, oneof Tags 200 stringTags. |
VisionFeaturePrint (2002) | oneof 20 scene (version = 1: 0 invalid, 1 SCENE_VERSION_1 (iOS and tvOS 12.0, macOS 10.14; 299 × 299 input, 2048-float vector), 2 SCENE_VERSION_2 (iOS and tvOS 17.0, macOS 14.0; 360 × 360 input, 768 floats)) or 21 objects (version = 1: 0 invalid, 1 OBJECTS_VERSION_1 (iOS and tvOS 14.0, macOS 11.0; 299 × 299 input, two multi-arrays of shape (288, 35, 35) and (768, 17, 17)); output = 100 [string], output names in the order the network computes them, the earlier one having the higher resolution). |
SoundAnalysisPreprocessing (2003) | oneof 20 vggish (no fields). Input: mono audio of 975 ms at 16 kHz (15,600 samples, 1-D); output shape [1, 96, 64]. Steps: 25 ms frames hopping 10 ms (partial last frame dropped); periodic Hann window of 400 samples, w(n) = 0.5 − 0.5 cos(2πn / 400); short-time Fourier transform magnitude with FFT length 512; log mel filter bank from 125 Hz to 7500 Hz, 64 mel bins, log offset 0.01, 64 spectrum bins (reference: arXiv 1609.09430). |
Gazetteer (2004) | revision = 1 (revision 2 is iOS and tvOS 13.0, macOS 10.15), language = 10, modelParameterData = 100, oneof ClassLabels 200 stringClassLabels. |
WordEmbedding (2005) | revision = 1 (revision 2 is iOS and tvOS 13.0, macOS 10.15), language = 10, modelParameterData = 100. |
AudioFeaturePrint (2006) | oneof 20 sound (version = 1: 0 SOUND_VERSION_INVALID, 1 SOUND_VERSION_1 (iOS and tvOS 15.0, macOS 12.0; variable-length audio input, 512-float feature vector)). |
SerializedModel (3000) | identifier = 1 (string naming the model type of the serialised message) and model = 2 (bytes: a valid serialised protocol buffer of that type). Model.proto marks field numbers from 3000 as reserved private messages "subject to change with no notice or support". |
| Updatable-model parameters | For neural networks, training is configured by NetworkUpdateParameters (above) with the parameter messages of Parameters.proto, and a layer or weight is marked updatable with isUpdatable. KNearestNeighborsClassifier uses Int64Parameter for numberOfNeighbors. No other training structure was found in the files read. |
Blob v2 weight file
An ML Program value stored with blobFileValue points into a weight file (for
example weights/weight.bin). The layout is in
mlmodel/src/MILBlob/Blob/StorageFormat.hpp, BlobDataType.hpp and
StorageWriter.cpp (apple/coremltools main, read 2026-11-13). The header calls it
the default file format for Core ML from iOS 15, and says version 1 in the header is the
Espresso blob_v1 format.
- Structure: a 64-byte
storage_header, then for each blob a 64-byteblob_metadatafollowed by the raw data; each metadata and each data block starts on a 64-byte boundary (padding is inserted). - storage_header (64 bytes):
countuint32 (number of blobs; the writer rewrites it at offset 0 after each blob),versionuint32 (default and only supported value 2), then seven reserved uint64. - blob_metadata (64 bytes,
static_asserted):sentineluint32 =0xDEADBEEF(to validate the metadata),mil_dtypeuint32,sizeInBytesuint64,offsetuint64 (file offset of the data),padding_size_in_bitsuint64 (unused bits at the end of a blob of sub-byte values: (8 − bits mod 8) when the bit count is not a multiple of 8, zero otherwise), then four reserved uint64. Before iOS 18 the reserved fields were uninitialised; from iOS 18 they are zero. - Addressing: the
offsetin ablobFileValueis the byte offset of the blob'sblob_metadata(the writer returns the metadata offset); the data offset follows as metadata offset + 64. The header's own example puts the first blob's metadata at 64 and data at 128, the next metadata at 256. mil_dtypevalues (new values only at the end, for binary compatibility): 1 Float16, 2 Float32, 3 UInt8, 4 Int8, 5 BFloat16, 6 Int16, 7 UInt16, 8 Int4, 9 UInt1, 10 UInt2, 11 UInt4, 12 UInt3, 13 UInt6, 14 Int32, 15 UInt32, 16 Float8E4M3FN, 17 Float8E5M2.
ML Program operation set
An Operation's type string is the name of an operation of the
MIL operator set. The set is defined in Python, in
coremltools/converters/mil/mil/ops/defs/ (apple/coremltools main, read
2026-11-13), one folder per opset: iOS15 (the base), iOS16,
iOS17 and iOS18. A later folder re-registers an operation with a
new definition (for example conv in iOS17) or adds new ones. The names below
are the classes registered with @register_op; their inputs, outputs and
constraints are in the class docstrings of those files (this page does not copy them).
| Opset | Operations |
|---|---|
| iOS15 | Activation: clamped_relu, elu, gelu, leaky_relu, linear_activation, prelu, relu, relu6, scaled_tanh, sigmoid, sigmoid_hard, silu, softplus, softplus_parametric, softmax, softsign, thresholded_relu. Classify: classify. Control flow: cond, const, select, while_loop, make_list, list_length, list_write, list_read, list_gather, list_scatter. Convolution: conv, conv_quantized, conv_transpose. Binary: add, equal, floor_div, greater, greater_equal, less, less_equal, logical_and, logical_or, logical_xor, maximum, minimum, mod, mul, not_equal, real_div, pow, sub. Unary: abs, acos, asin, atan, atanh, ceil, clip, cos, cosh, erf, exp, exp2, floor, inverse, log, logical_not, round, rsqrt, sign, sin, sinh, sqrt, square, tan, tanh, threshold, cast. Image: upsample_nearest_neighbor, resize_nearest_neighbor, upsample_bilinear, resize_bilinear, crop_resize, crop, affine, resample. Linear: linear, matmul, einsum. Normalisation: batch_norm, instance_norm, l2_norm, layer_norm, local_response_norm. Pooling: avg_pool, l2_pool, max_pool. Random: random_bernoulli, random_categorical, random_normal, random_uniform. Recurrent: gru, lstm, rnn. Reduction: reduce_argmax, reduce_argmin, reduce_l1_norm, reduce_l2_norm, reduce_log_sum, reduce_log_sum_exp, reduce_max, reduce_mean, reduce_min, reduce_prod, reduce_sum, reduce_sum_square. Scatter and gather: gather, scatter, gather_along_axis, scatter_along_axis, gather_nd, scatter_nd. Tensor: band_part, cumsum, fill, non_maximum_suppression, non_zero, one_hot, pad, range_1d, tile, argsort, topk, flatten2d, shape, concat, split, stack, identity. Transformation: depth_to_space, expand_dims, reshape, reverse, reverse_sequence, slice_by_index, slice_by_size, space_to_depth, space_to_batch, batch_to_space, squeeze, transpose, pixel_shuffle, sliding_windows. |
| iOS16 | New: constexpr_affine_dequantize, constexpr_cast, constexpr_lut_to_dense, constexpr_sparse_to_dense, fill_like, reshape_like, pixel_unshuffle. Updated: resample, upsample_bilinear, crop_resize, gather, gather_along_axis, gather_nd, topk. |
| iOS17 | New: quantize, dequantize, resize. Updated: clamped_relu, elu, leaky_relu, linear_activation, prelu, scaled_tanh, sigmoid_hard, softplus_parametric, thresholded_relu, conv, conv_transpose, cast, clip, inverse, log, rsqrt, crop_resize, resample, linear, matmul, batch_norm, instance_norm, l2_norm, layer_norm, local_response_norm, gru, lstm, rnn, reduce_argmax, reduce_argmin, scatter, scatter_along_axis, scatter_nd, gather, gather_along_axis, gather_nd, non_maximum_suppression, topk, reshape, reshape_like, expand_dims, squeeze, reverse, reverse_sequence, sliding_windows, transpose, slice_by_index, slice_by_size. |
| iOS18 | New: constexpr_blockwise_shift_scale, constexpr_lut_to_sparse, constexpr_sparse_blockwise_shift_scale, read_state, slice_update, scaled_dot_product_attention. Updated: constexpr_lut_to_dense, constexpr_sparse_to_dense, constexpr_cast, gru. |
ML Program (MIL.proto)
From MIL.proto (read 2026-11-13), the model body at field 502. A
Program holds functions; a Function has named inputs and a
block for the chosen opset; a Block has named inputs, output names and
topologically sorted operations; an Operation has a type, named inputs, outputs
and optional nested blocks for control flow. Identifiers match
[A-Za-z_][A-Za-z0-9_@]*. Programs, functions, blocks, operations and
tensor types may carry attributes (a map of identifier to Value).
| Message | Fields |
|---|---|
Program | version = 1 (int64), functions = 2 (map string to Function; unique names), docString = 3, attributes = 4. |
Function | inputs = 1 (repeated NamedValueType; image inputs are rank-4 float32, NCHW with N = 1, C = 1 or 3), opset = 2 (the key into the next field of the active block), block_specializations = 3 (map opset name to Block; every block yields the same outputs and inherits the function's scope), attributes = 4. |
Block | inputs = 1 (block-local names, for example for while_loop), outputs = 2 (repeated names; the type of output i is the type of that operation output), operations = 3, attributes = 4. |
Operation | type = 1 (such as convolution), inputs = 2 (map parameter name to Argument: a list of Binding, each oneof 1 name of an earlier value or 2 value, a compile-time constant; one binding in general, several for a concat), outputs = 3 (NamedValueType; names valid and unique in scope), blocks = 4 (a conditional has two), attributes = 5. |
NamedValueType | name = 1, type = 2 (ValueType). |
ValueType | oneof 1 tensorType, 2 listType, 3 tupleType, 4 dictionaryType, 5 stateType. |
DataType | 0 UNUSED_TYPE, 1 BOOL, 2 STRING, 10 FLOAT16, 11 FLOAT32, 12 FLOAT64, 13 BFLOAT16, 21 INT8, 22 INT16, 23 INT32, 24 INT64, 25 INT4, 31 UINT8, 32 UINT16, 33 UINT32, 34 UINT64, 35 UINT4, 36 UINT2, 37 UINT1, 38 UINT6, 39 UINT3, 40 FLOAT8E4M3FN, 41 FLOAT8E5M2. |
TensorType | dataType = 1, rank = 2 (−1 for variable rank), dimensions = 3 (repeated Dimension, length = rank), attributes = 4. Dimension: oneof 1 constant (size uint64) or 2 unknown (variadic bool). |
ListType, TupleType, DictionaryType, StateType | List: type = 1, length = 2 (a Dimension, possibly unknown). Tuple: types = 1. Dictionary: keyType = 1, valueType = 2 (unordered). State: wrappedType = 1. |
Value | docString = 1, type = 2, then oneof 3 immediateValue (tensor 1, tuple 2, list 3, dictionary 4) or 5 blobFileValue (fileName = 1, offset = 2: a byte offset to metadata in a "blob v2" weight file). |
TensorValue | oneof 1 floats, 2 ints (int32), 3 bools, 4 strings, 5 longInts, 6 doubles, 7 bytes (one bytes field), the numeric ones packed. |
TupleValue, ListValue, DictionaryValue | Recursive lists of Value; the dictionary holds KeyValuePair (key = 1, value = 2). |