202 references to CheckDecode
Microsoft.ML.Core (43)
Data\ModelHeader.cs (31)
326
Contracts.
CheckDecode
(headerBytes.Length == ModelHeader.Size);
342
Contracts.
CheckDecode
(header.FpModel + header.CbModel == reader.FpCur() - fpMin);
398
Contracts.
CheckDecode
(header.FpModel == Size);
399
Contracts.
CheckDecode
(header.FpModel + header.CbModel >= header.FpModel);
404
Contracts.
CheckDecode
(header.CbStringTable == 0);
405
Contracts.
CheckDecode
(header.FpStringChars == 0);
406
Contracts.
CheckDecode
(header.CbStringChars == 0);
409
Contracts.
CheckDecode
(header.FpTail == header.FpModel + header.CbModel);
415
Contracts.
CheckDecode
(header.FpStringTable == header.FpModel + header.CbModel);
416
Contracts.
CheckDecode
(header.CbStringTable % sizeof(long) == 0);
417
Contracts.
CheckDecode
(header.CbStringTable / sizeof(long) < int.MaxValue);
418
Contracts.
CheckDecode
(header.FpStringTable + header.CbStringTable > header.FpStringTable);
419
Contracts.
CheckDecode
(header.FpStringChars == header.FpStringTable + header.CbStringTable);
420
Contracts.
CheckDecode
(header.CbStringChars % sizeof(char) == 0);
421
Contracts.
CheckDecode
(header.FpStringChars + header.CbStringChars >= header.FpStringChars);
424
Contracts.
CheckDecode
(header.FpTail == header.FpStringChars + header.CbStringChars);
432
Contracts.
CheckDecode
(header.CbAssemblyName == 0);
439
Contracts.
CheckDecode
(header.FpAssemblyName == header.FpModel + header.CbModel);
443
Contracts.
CheckDecode
(header.FpAssemblyName == header.FpStringChars + header.CbStringChars);
445
Contracts.
CheckDecode
(header.CbAssemblyName % sizeof(char) == 0);
446
Contracts.
CheckDecode
(header.FpTail == header.FpAssemblyName + header.CbAssemblyName);
450
Contracts.
CheckDecode
(header.FpLim == header.FpTail + sizeof(ulong));
451
Contracts.
CheckDecode
(size == 0 || size >= header.FpLim);
509
Contracts.
CheckDecode
(offsets[cstr - 1] == header.CbStringChars);
516
Contracts.
CheckDecode
(header.FpStringChars + offset == reader.FpCur() - fpMin);
520
Contracts.
CheckDecode
(offsetPrev <= offset && offset <= header.CbStringChars);
521
Contracts.
CheckDecode
(offset % sizeof(char) == 0);
523
Contracts.
CheckDecode
(cch < int.MaxValue);
530
Contracts.
CheckDecode
(offset == header.CbStringChars);
531
Contracts.
CheckDecode
(header.FpStringChars + header.CbStringChars == reader.FpCur() - fpMin);
551
Contracts.
CheckDecode
(header.FpTail == reader.FpCur() - fpMin);
Data\ModelLoadContext.cs (1)
153
Contracts.
CheckDecode
(0 <= id && id < Utils.Size(Strings));
Utilities\Stream.cs (11)
458
Contracts.
CheckDecode
(b <= 1);
472
Contracts.
CheckDecode
(size >= 0);
515
Contracts.
CheckDecode
(size >= 0);
537
Contracts.
CheckDecode
(size >= 0);
560
Contracts.
CheckDecode
(size >= 0);
583
Contracts.
CheckDecode
(size >= 0);
606
Contracts.
CheckDecode
(size >= 0);
631
Contracts.
CheckDecode
(size >= 0);
654
Contracts.
CheckDecode
(size >= 0);
666
Contracts.
CheckDecode
(bytes.Length == size);
673
Contracts.
CheckDecode
(numBits >= 0);
Microsoft.ML.Data (115)
DataLoadSave\Binary\Codecs.cs (24)
362
Contracts.
CheckDecode
(_entries == items);
369
Contracts.
CheckDecode
(b >= (bPrev & LengthMask) || (b & LengthMask) == (bPrev & LengthMask));
373
Contracts.
CheckDecode
(_text.Length == (_boundaries[_entries] & LengthMask));
983
Contracts.
CheckDecode
(_numVectors == items);
988
Contracts.
CheckDecode
(codec._type.Size == _size);
990
Contracts.
CheckDecode
(_size >= 0);
997
Contracts.
CheckDecode
(numIndices >= 0);
1006
Contracts.
CheckDecode
(len >= 0);
1009
Contracts.
CheckDecode
(count == -1);
1015
Contracts.
CheckDecode
(count < len);
1024
Contracts.
CheckDecode
(prev < _indices[j]);
1028
Contracts.
CheckDecode
(prev < len);
1129
Contracts.
CheckDecode
(itemType != null);
1138
Contracts.
CheckDecode
(d >= 0);
1242
Contracts.
CheckDecode
(itemType != null);
1243
Contracts.
CheckDecode
(KeyDataViewType.IsValidDataType(itemType.RawType));
1252
Contracts.
CheckDecode
(min == 0);
1253
Contracts.
CheckDecode
(0 <= count);
1254
Contracts.
CheckDecode
((ulong)count <= itemType.GetRawKind().ToMaxInt());
1255
Contracts.
CheckDecode
(contiguous);
1339
Contracts.
CheckDecode
(itemType != null);
1340
Contracts.
CheckDecode
(KeyDataViewType.IsValidDataType(itemType.RawType));
1346
Contracts.
CheckDecode
(0 < count);
1347
Contracts.
CheckDecode
(count <= itemType.RawType.ToMaxInt());
DataLoadSave\Database\DatabaseLoader.cs (6)
561
Contracts.
CheckDecode
(cinfo > 0);
570
Contracts.
CheckDecode
(Enum.IsDefined(typeof(InternalDataKind), kind));
575
Contracts.
CheckDecode
(KeyDataViewType.IsValidDataType(kind.ToType()));
578
Contracts.
CheckDecode
(0 < count);
595
Contracts.
CheckDecode
(cseg > 0);
602
Contracts.
CheckDecode
(0 <= min && min < lim);
DataLoadSave\Text\TextLoader.cs (9)
923
Contracts.
CheckDecode
(cinfo > 0);
935
Contracts.
CheckDecode
(Enum.IsDefined(typeof(InternalDataKind), kind));
940
Contracts.
CheckDecode
(KeyDataViewType.IsValidDataType(kind.ToType()));
947
Contracts.
CheckDecode
(isContig);
949
Contracts.
CheckDecode
(min == 0);
951
Contracts.
CheckDecode
(cnt >= 0);
960
Contracts.
CheckDecode
(0 < count);
968
Contracts.
CheckDecode
(cseg > 0);
974
Contracts.
CheckDecode
(0 <= min && min < lim && lim <= SrcLim);
DataLoadSave\Transpose\TransposeLoader.cs (1)
202
/// should be handle with <see cref="Contracts.
CheckDecode
(bool)"/> or by throwing
Deprecated\Instances\HeaderSchema.cs (4)
196
Contracts.
CheckDecode
(size >= 0);
199
Contracts.
CheckDecode
(isize >= -1);
218
Contracts.
CheckDecode
(prev < indices[ii]);
221
Contracts.
CheckDecode
(prev < size);
Scorers\BinaryClassifierScorer.cs (1)
154
Contracts.
CheckDecode
(cbFloat == sizeof(float));
Scorers\FeatureContributionCalculation.cs (2)
155
Contracts.
CheckDecode
(0 <= _topContributionsCount);
157
Contracts.
CheckDecode
(0 <= _bottomContributionsCount);
Scorers\RowToRowScorerBase.cs (1)
392
Contracts.
CheckDecode
(count >= 0);
Scorers\SchemaBindablePredictorWrapper.cs (4)
665
Contracts.
CheckDecode
(qpred != null);
667
Contracts.
CheckDecode
(ScoreType == NumberDataViewType.Single);
668
Contracts.
CheckDecode
(ValueMapper != null && ValueMapper.InputType is VectorDataViewType vectorType
671
Contracts.
CheckDecode
(Utils.Size(_quantiles) > 0);
Transforms\ColumnConcatenatingTransformer.cs (7)
207
Contracts.
CheckDecode
(n > 0);
295
Contracts.
CheckDecode
(n > 0);
321
Contracts.
CheckDecode
(sizeofFloat == sizeof(float));
324
Contracts.
CheckDecode
(n > 0);
331
Contracts.
CheckDecode
(numSources > 0);
351
Contracts.
CheckDecode
(0 <= j && j < length);
352
Contracts.
CheckDecode
(aliases[i][j] == null);
Transforms\ColumnSelecting.cs (4)
279
Contracts.
CheckDecode
(count > 0);
285
Contracts.
CheckDecode
(names.Add(name));
350
Contracts.
CheckDecode
(count >= 0);
357
Contracts.
CheckDecode
(names.Add(dst));
Transforms\FeatureContributionCalculationTransformer.cs (2)
123
Contracts.
CheckDecode
(0 <= Top);
125
Contracts.
CheckDecode
(0 <= Bottom);
Transforms\GenerateNumberTransform.cs (1)
148
Contracts.
CheckDecode
(size > 0);
Transforms\Hashing.cs (1)
1864
Contracts.
CheckDecode
(NumBitsMin <= NumberOfBits && NumberOfBits < NumBitsLim);
Transforms\NormalizeColumnDbl.cs (19)
106
Contracts.
CheckDecode
(cbFloat == sizeof(TFloat));
109
Contracts.
CheckDecode
(size > 0);
114
Contracts.
CheckDecode
(-1 <= morphCount && morphCount < size);
123
Contracts.
CheckDecode
(scaleCount == size);
126
Contracts.
CheckDecode
(offsetCount == 0 || offsetCount == size);
134
Contracts.
CheckDecode
(!TFloat.IsNaN(scale));
143
Contracts.
CheckDecode
(!TFloat.IsNaN(offset));
154
Contracts.
CheckDecode
(scaleCount == morphCount);
157
Contracts.
CheckDecode
(offsetCount == 0 || offsetCount == morphCount);
167
Contracts.
CheckDecode
(ivPrev < iv && iv < numFeatures);
170
Contracts.
CheckDecode
(!TFloat.IsNaN(scale));
179
Contracts.
CheckDecode
(!TFloat.IsNaN(offset));
246
Contracts.
CheckDecode
(cbFloat == sizeof(TFloat));
250
Contracts.
CheckDecode
(numFeatures > 0);
255
Contracts.
CheckDecode
(Utils.Size(curUpperBounds) > 0);
258
Contracts.
CheckDecode
(curUpperBounds[j - 1] < curUpperBounds[j]);
259
Contracts.
CheckDecode
(curUpperBounds[curUpperBounds.Length - 1] == TFloat.PositiveInfinity);
300
Contracts.
CheckDecode
(cbFloat == sizeof(TFloat));
305
Contracts.
CheckDecode
(size > 0);
Transforms\NormalizeColumnSng.cs (19)
106
Contracts.
CheckDecode
(cbFloat == sizeof(TFloat));
109
Contracts.
CheckDecode
(size > 0);
114
Contracts.
CheckDecode
(-1 <= morphCount && morphCount < size);
123
Contracts.
CheckDecode
(scaleCount == size);
126
Contracts.
CheckDecode
(offsetCount == 0 || offsetCount == size);
134
Contracts.
CheckDecode
(!TFloat.IsNaN(scale));
143
Contracts.
CheckDecode
(!TFloat.IsNaN(offset));
154
Contracts.
CheckDecode
(scaleCount == morphCount);
157
Contracts.
CheckDecode
(offsetCount == 0 || offsetCount == morphCount);
167
Contracts.
CheckDecode
(ivPrev < iv && iv < numFeatures);
170
Contracts.
CheckDecode
(!TFloat.IsNaN(scale));
179
Contracts.
CheckDecode
(!TFloat.IsNaN(offset));
246
Contracts.
CheckDecode
(cbFloat == sizeof(TFloat));
250
Contracts.
CheckDecode
(numFeatures > 0);
255
Contracts.
CheckDecode
(Utils.Size(curUpperBounds) > 0);
258
Contracts.
CheckDecode
(curUpperBounds[j - 1] < curUpperBounds[j]);
259
Contracts.
CheckDecode
(curUpperBounds[curUpperBounds.Length - 1] == TFloat.PositiveInfinity);
300
Contracts.
CheckDecode
(cbFloat == sizeof(TFloat));
305
Contracts.
CheckDecode
(size > 0);
Transforms\Normalizer.cs (4)
437
Contracts.
CheckDecode
(vectorSize >= 0);
438
Contracts.
CheckDecode
(vectorSize > 0 || !isVectorOld);
440
Contracts.
CheckDecode
(itemKindOld == InternalDataKind.R4 || itemKindOld == InternalDataKind.R8);
454
Contracts.
CheckDecode
(itemKind == InternalDataKind.R4 || itemKind == InternalDataKind.R8);
Utilities\TypeParsingUtils.cs (1)
145
Contracts.
CheckDecode
(Count == null || Count > 0);
Utils\SequencePool.cs (5)
71
Contracts.
CheckDecode
(0 <= _idLim && _idLim < int.MaxValue);
73
Contracts.
CheckDecode
(Utils.Size(_start) > 0 && _start[0] == 0);
74
Contracts.
CheckDecode
(_start[_idLim] >= 0);
97
Contracts.
CheckDecode
(_start[id] <= _start[id + 1] && _start[id + 1] <= cb);
358
Contracts.
CheckDecode
(TryDecodeOne(bytes, ref cur, lim, out sequence[count]));
Microsoft.ML.FastTree (1)
TreeEnsemble\InternalTreeEnsemble.cs (1)
52
Contracts.
CheckDecode
(numTrees >= 0);
Microsoft.ML.ImageAnalytics (13)
ImagePixelExtractor.cs (6)
709
Contracts.
CheckDecode
(ColorsToExtract != 0);
710
Contracts.
CheckDecode
((ColorsToExtract & ImagePixelExtractingEstimator.ColorBits.All) == ColorsToExtract);
716
Contracts.
CheckDecode
(OrderOfExtraction != 0);
728
Contracts.
CheckDecode
(FloatUtils.IsFinite(OffsetImage));
730
Contracts.
CheckDecode
(FloatUtils.IsFiniteNonZero(ScaleImage));
731
Contracts.
CheckDecode
(OutputAsFloatArray || OffsetImage == 0 && ScaleImage == 1);
VectorToImageTransform.cs (7)
547
Contracts.
CheckDecode
(Colors != 0);
548
Contracts.
CheckDecode
((Colors & ImagePixelExtractingEstimator.ColorBits.All) == Colors);
562
Contracts.
CheckDecode
(Order != 0);
566
Contracts.
CheckDecode
(ImageWidth > 0);
568
Contracts.
CheckDecode
(ImageHeight > 0);
570
Contracts.
CheckDecode
(FloatUtils.IsFinite(OffsetImage));
572
Contracts.
CheckDecode
(FloatUtils.IsFiniteNonZero(ScaleImage));
Microsoft.ML.Mkl.Components (6)
OlsLinearRegression.cs (2)
883
Contracts.
CheckDecode
(Math.Sign(param) == Math.Sign(tvalue));
888
Contracts.
CheckDecode
(0 <= p && p <= 1);
VectorWhitening.cs (4)
817
Contracts.
CheckDecode
(Kind == WhiteningKind.PrincipalComponentAnalysis || Kind == WhiteningKind.ZeroPhaseComponentAnalysis);
819
Contracts.
CheckDecode
(0 <= Epsilon && Epsilon < float.PositiveInfinity);
821
Contracts.
CheckDecode
(MaximumNumberOfRows > 0);
824
Contracts.
CheckDecode
(Rank >= 0);
Microsoft.ML.PCA (3)
PcaTransformer.cs (3)
129
Contracts.
CheckDecode
(0 < Rank && Rank <= Dimension);
135
Contracts.
CheckDecode
(FloatUtils.IsFinite(Eigenvectors[i]));
139
Contracts.
CheckDecode
(MeanProjected == null || (MeanProjected.Length == Rank && FloatUtils.IsFinite(MeanProjected)));
Microsoft.ML.Transforms (21)
CompositeTransformer.cs (1)
49
Contracts.
CheckDecode
(numFunctions > 0);
GcnTransform.cs (3)
846
Contracts.
CheckDecode
(Enum.IsDefined(typeof(NormFunction), normKindVal));
852
Contracts.
CheckDecode
(normKindSerialized ||
855
Contracts.
CheckDecode
(0 < Scale && Scale < float.PositiveInfinity);
OptionalColumnTransform.cs (1)
109
Contracts.
CheckDecode
(size > 0);
Text\NgramHashingTransformer.cs (10)
287
Contracts.
CheckDecode
(columnsLength > 0);
312
Contracts.
CheckDecode
(csrc > 0);
1006
Contracts.
CheckDecode
(0 < NgramLength && NgramLength <= NgramBufferBuilder.MaxSkipNgramLength);
1008
Contracts.
CheckDecode
(0 <= SkipLength && SkipLength <= NgramBufferBuilder.MaxSkipNgramLength);
1009
Contracts.
CheckDecode
(SkipLength <= NgramBufferBuilder.MaxSkipNgramLength - NgramLength);
1011
Contracts.
CheckDecode
(1 <= NumberOfBits && NumberOfBits <= 30);
1036
Contracts.
CheckDecode
(0 < NgramLength && NgramLength <= NgramBufferBuilder.MaxSkipNgramLength);
1038
Contracts.
CheckDecode
(0 <= SkipLength && SkipLength <= NgramBufferBuilder.MaxSkipNgramLength);
1039
Contracts.
CheckDecode
(SkipLength <= NgramBufferBuilder.MaxSkipNgramLength - NgramLength);
1041
Contracts.
CheckDecode
(1 <= NumberOfBits && NumberOfBits <= 30);
Text\NgramTransform.cs (4)
153
Contracts.
CheckDecode
(0 < NgramLength && NgramLength <= NgramBufferBuilder.MaxSkipNgramLength);
155
Contracts.
CheckDecode
(0 <= SkipLength && SkipLength <= NgramBufferBuilder.MaxSkipNgramLength);
156
Contracts.
CheckDecode
(NgramLength <= NgramBufferBuilder.MaxSkipNgramLength - SkipLength);
160
Contracts.
CheckDecode
(Enum.IsDefined(typeof(NgramExtractingEstimator.WeightingCriteria), Weighting));
Text\StopWordsRemovingTransformer.cs (1)
237
Contracts.
CheckDecode
(Enum.IsDefined(typeof(StopWordsRemovingEstimator.Language), lang));
Text\WordTokenizing.cs (1)
141
Contracts.
CheckDecode
(Utils.Size(separators) > 0);