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