201 references to Check
Microsoft.ML.Core (46)
CommandLine\ArgumentAttribute.cs (1)
58
Contracts.
Check
(value == null || !(this is DefaultArgumentAttribute));
CommandLine\CmdParser.cs (2)
476
Contracts.
Check
(!field.IsStatic && !field.IsInitOnly && !field.IsLiteral);
1424
Contracts.
Check
(nicks == null || nicks.All(nick => !string.IsNullOrWhiteSpace(nick)));
Data\DataKind.cs (2)
141
Contracts.
Check
(0 <= index && index < KindCount);
158
Contracts.
Check
(kind != InternalDataKind.UG);
Data\ModelHeader.cs (17)
138
Contracts.
Check
(header.FpStringTable == 0);
139
Contracts.
Check
(header.CbStringTable == 0);
140
Contracts.
Check
(header.FpStringChars == 0);
141
Contracts.
Check
(header.CbStringChars == 0);
211
Contracts.
Check
(res);
228
Contracts.
Check
(header.FpModel == ModelHeader.Size);
229
Contracts.
Check
(header.CbModel == 0);
232
Contracts.
Check
(fpCur - fpMin >= header.FpModel);
262
Contracts.
Check
(sig.Length <= 24);
266
Contracts.
Check
(ch <= 0xFF);
288
Contracts.
Check
(sig.Length <= 24);
292
Contracts.
Check
(ch <= 0xFF);
307
Contracts.
Check
(Utils.Size(bytes) >= Size);
374
Contracts.
Check
(Utils.Size(bytes) >= Size);
388
Contracts.
Check
(size >= 0);
469
Contracts.
Check
(fpMin >= 0);
648
Contracts.
Check
(ch <= 0xFF);
Data\ProgressReporter.cs (3)
525
Contracts.
Check
(0 <= index && index < Progress.Length);
536
Contracts.
Check
(0 <= index && index < Progress.Length);
547
Contracts.
Check
(0 <= index && index < Metrics.Length);
Utilities\BinFinder.cs (8)
30
Contracts.
Check
(cbin >= 2);
31
Contracts.
Check
(numZeroes >= 0);
108
Contracts.
Check
(cbin >= 2);
109
Contracts.
Check
(numZeroes >= 0);
185
Contracts.
Check
(cbin >= 2);
186
Contracts.
Check
(numValues > cbin);
187
Contracts.
Check
(counts.Count >= numValues);
188
Contracts.
Check
(path.Length >= cbin + 1);
Utilities\HashArray.cs (1)
237
Contracts.
Check
(destination.Length >= _ct);
Utilities\Hashing.cs (3)
344
Contracts.
Check
(0 <= min);
345
Contracts.
Check
(min <= lim);
346
Contracts.
Check
(lim <= Utils.Size(data));
Utilities\Heap.cs (5)
141
Contracts.
Check
(cv > 1);
355
Contracts.
Check
(iv > 0);
381
Contracts.
Check
(!item.InHeap);
398
Contracts.
Check
(item.InHeap);
401
Contracts.
Check
(Get(ivDst) == item);
Utilities\TaskExtensions.cs (1)
16
Contracts.
Check
(task.IsCompleted);
Utilities\Utils.cs (2)
700
Contracts.
Check
(values.Length >= len);
848
Contracts.
Check
(col.Index < lim);
Utilities\VBufferUtils.cs (1)
401
Contracts.
Check
(0 <= denseCount && denseCount <= dst.Length);
Microsoft.ML.Data (76)
Data\BufferBuilder.cs (1)
395
Contracts.
Check
(0 <= index && index <= _length - buffer.Length);
Data\Combiner.cs (1)
40
Contracts.
Check
(IsDefault(dst));
Data\Conversion.cs (3)
386
Contracts.
Check
(typeSrc.RawType == typeof(TSrc));
387
Contracts.
Check
(typeDst.RawType == typeof(TDst));
515
Contracts.
Check
(key.RawType == typeof(TSrc));
Data\RowCursorUtils.cs (3)
276
Contracts.
Check
(src.Length == size);
307
Contracts.
Check
(0 <= col && col < cursor.Schema.Count);
309
Contracts.
Check
(type is KeyDataViewType);
DataLoadSave\Binary\CodecFactory.cs (1)
132
Contracts.
Check
(mem.Length <= int.MaxValue); // Is this even possible in the current implementation of MemoryStream?
DataLoadSave\Database\DatabaseLoaderCursor.cs (2)
772
Contracts.
Check
(segs.Length == 1);
778
Contracts.
Check
(seg.Lim == (seg.Min + 1));
DataLoadSave\Text\TextLoaderParser.cs (2)
287
Contracts.
Check
(index >= 0);
471
Contracts.
Check
(index >= 0);
DataLoadSave\Text\TextSaver.cs (3)
650
Contracts.
Check
(index >= 0);
652
Contracts.
Check
(dst > _dstPrev);
680
Contracts.
Check
(_dstPrev < dst);
DataLoadSave\TransformerChain.cs (3)
93
Contracts.
Check
((_transformers.Length > 0) == (LastTransformer != null));
94
Contracts.
Check
(_transformers.Length == _scopes.Length);
117
Contracts.
Check
(LastTransformer != null);
DataLoadSave\TransformWrapper.cs (1)
26
Contracts.
Check
(xf is IDataTransform);
DataView\DataViewConstructionUtils.cs (6)
918
Contracts.
Check
(typeof(TDst).IsGenericType && typeof(TDst).GetGenericTypeDefinition() == typeof(VBuffer<>));
925
Contracts.
Check
(dstItemType == typeof(ReadOnlyMemory<char>));
932
Contracts.
Check
(itemType == dstItemType);
942
Contracts.
Check
(typeof(TDst).IsGenericType);
944
Contracts.
Check
(typeof(TDst).GetGenericTypeDefinition() == typeof(VBuffer<>));
948
Contracts.
Check
(itemType == dstItemType);
DataView\SimpleRow.cs (3)
42
Contracts.
Check
(Utils.Size(getters) == schema.Count);
58
Contracts.
Check
(IsColumnActive(column));
69
Contracts.
Check
(column.Index < _getters.Length);
DataView\Transposer.cs (2)
1060
Contracts.
Check
(IsColumnActive(column));
1169
Contracts.
Check
(IsColumnActive(column) && column.Index < _getters.Length);
Deprecated\Vector\VectorUtils.cs (4)
26
Contracts.
Check
(Utils.Size(a) > 0);
253
Contracts.
Check
(0 <= offset && offset <= a.Length);
305
Contracts.
Check
(0 <= offset && offset <= a.Length);
471
Contracts.
Check
(0 <= offset && offset <= dst.Length);
EntryPoints\EntryPointNode.cs (1)
1272
Contracts.
Check
(index >= 0);
EntryPoints\InputBuilder.cs (1)
220
Contracts.
Check
(instance.GetType() == _type);
Evaluators\EvaluatorUtils.cs (3)
378
Contracts.
Check
(typeSrc.RawType == typeof(TSrc));
412
Contracts.
Check
(typeSrc.RawType == typeof(TSrc));
1479
Contracts.
Check
(type != null && type.IsKnownSize && type.ItemType == NumberDataViewType.Double);
Evaluators\MultiOutputRegressionEvaluator.cs (2)
321
Contracts.
Check
(_label.Length == _size);
323
Contracts.
Check
(_score.Length == _size);
Scorers\ClusteringScorer.cs (2)
110
Contracts.
Check
(score.Length == scoreLength);
121
Contracts.
Check
(score.Length == scoreLength);
Scorers\FeatureContributionCalculation.cs (2)
194
Contracts.
Check
(0 <= colSrc && colSrc < input.Schema.Count);
205
Contracts.
Check
(0 <= colSrc && colSrc < input.Schema.Count);
Scorers\SchemaBindablePredictorWrapper.cs (1)
723
Contracts.
Check
(features.Length == featureCount || featureCount == 0);
Transforms\ColumnBindingsBase.cs (3)
360
Contracts.
Check
(0 <= colHidden && colHidden < input.Count);
362
Contracts.
Check
(str == name);
363
Contracts.
Check
(colMap[colHidden] == 0);
Transforms\NAFilter.cs (2)
350
Contracts.
Check
(Cursor.IsGood);
372
Contracts.
Check
(Cursor.IsGood);
Transforms\NormalizeColumnDbl.cs (9)
32
Contracts.
Check
(numFeatures > 0);
327
Contracts.
Check
(size > 0);
356
Contracts.
Check
(value.Length == size);
619
Contracts.
Check
(contatinerStartingSize > 0);
793
Contracts.
Check
(dst.Length == Scale.Length);
803
Contracts.
Check
(dst.Length == Scale.Length);
813
Contracts.
Check
(dst.Length == Scale.Length);
1500
Contracts.
Check
(binIdx < binUpperBounds.Length);
1511
Contracts.
Check
(binIdx < binUpperBounds.Length);
Transforms\NormalizeColumnSng.cs (9)
32
Contracts.
Check
(numFeatures > 0);
327
Contracts.
Check
(size > 0);
356
Contracts.
Check
(value.Length == size);
777
Contracts.
Check
(contatinerStartingSize > 0);
950
Contracts.
Check
(dst.Length == Scale.Length);
960
Contracts.
Check
(dst.Length == Scale.Length);
970
Contracts.
Check
(dst.Length == Scale.Length);
1663
Contracts.
Check
(binIdx < binUpperBounds.Length);
1674
Contracts.
Check
(binIdx < binUpperBounds.Length);
Transforms\ValueToKeyMappingTransformer.cs (1)
573
Contracts.
Check
(trainingData.Schema.TryGetColumnIndex(infos[iinfo].InputColumnName, out int colIndex));
Utilities\ModelFileUtils.cs (1)
379
Contracts.
Check
(index == 0);
Utilities\SlotDropper.cs (1)
52
Contracts.
Check
(SlotsMin.Length == _lengthReduction.Length);
Utils\SequencePool.cs (3)
200
Contracts.
Check
(0 <= min && min <= lim && lim <= Utils.Size(sequence));
221
Contracts.
Check
(0 <= min && min <= lim && lim <= Utils.Size(sequence));
302
Contracts.
Check
(0 <= id && id < _idLim);
Microsoft.ML.FastTree (8)
RandomForestRegression.cs (1)
189
Contracts.
Check
(ctx.Reader.ReadBoolByte());
Training\Applications\ObjectiveFunction.cs (1)
73
Contracts.
Check
(queue.TryDequeue(out threadIndex));
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (6)
1135
Contracts.
Check
(0 <= offset && offset + size <= buffer.Length);
1152
Contracts.
Check
(CategoricalSplitRange.Length == 2);
1155
Contracts.
Check
(offset - startIndex <= size);
1162
Contracts.
Check
(0 <= offset && offset + size <= buffer.Length);
1180
Contracts.
Check
(CategoricalSplitRange.Length == 2);
1182
Contracts.
Check
(offset - startIndex <= size);
Microsoft.ML.KMeansClustering (1)
KMeansPlusPlusTrainer.cs (1)
527
Contracts.
Check
(lookup.Count == n);
Microsoft.ML.LightGbm (1)
WrappedLightGbmBooster.cs (1)
238
Contracts.
Check
(kv.Length == 2);
Microsoft.ML.StandardTrainers (25)
Optimizer\SgdOptimizer.cs (5)
34
Contracts.
Check
(value > 0);
49
Contracts.
Check
(0 <= value && value < 1);
64
Contracts.
Check
(value >= 0);
106
Contracts.
Check
(value >= 0);
257
Contracts.
Check
(value >= 0);
Standard\LinearModelParameters.cs (4)
311
Contracts.
Check
(typeof(TIn) == typeof(VBuffer<float>));
312
Contracts.
Check
(typeof(TOut) == typeof(float));
404
Contracts.
Check
(typeof(TSrc) == typeof(VBuffer<float>));
405
Contracts.
Check
(typeof(TDstContributions) == typeof(VBuffer<float>));
Standard\LogisticRegression\MulticlassLogisticRegression.cs (2)
509
Contracts.
Check
(Utils.Size(weights) == NumberOfClasses);
510
Contracts.
Check
(Utils.Size(bias) == NumberOfClasses);
Standard\MulticlassClassification\OneVersusAllTrainer.cs (4)
633
Contracts.
Check
(src.Length == inputSize);
689
Contracts.
Check
(Utils.Size(predictors) > 0);
726
Contracts.
Check
(src.Length == inputSize);
882
Contracts.
Check
(src.Length == inputSize);
Standard\Simple\SimpleTrainers.cs (10)
126
Contracts.
Check
(typeof(TIn) == typeof(VBuffer<float>));
127
Contracts.
Check
(typeof(TOut) == typeof(float));
135
Contracts.
Check
(typeof(TIn) == typeof(VBuffer<float>));
136
Contracts.
Check
(typeof(TOut) == typeof(float));
137
Contracts.
Check
(typeof(TDist) == typeof(float));
447
Contracts.
Check
(typeof(TIn) == typeof(VBuffer<float>));
448
Contracts.
Check
(typeof(TOut) == typeof(float));
456
Contracts.
Check
(typeof(TIn) == typeof(VBuffer<float>));
457
Contracts.
Check
(typeof(TOut) == typeof(float));
458
Contracts.
Check
(typeof(TDist) == typeof(float));
Microsoft.ML.Sweeper (4)
Algorithms\NelderMead.cs (1)
133
Contracts.
Check
(run != null);
ISweeper.cs (1)
247
Contracts.
Check
(otherTyped != null);
Parameters.cs (2)
137
Contracts.
Check
(!float.IsNaN(value));
476
Contracts.
Check
(options.Values.Length > 0);
Microsoft.ML.TestFramework (4)
BaseTestBaseline.cs (1)
95
Contracts.
Check
(Directory.Exists(baselineRootDir));
BytesStreamSource.cs (2)
34
Contracts.
Check
(index == 0);
40
Contracts.
Check
(index == 0);
SubComponent.cs (1)
209
Contracts.
Check
(type != null && typeof(SubComponent).IsAssignableFrom(type));
Microsoft.ML.TimeSeries (4)
PredictionEngine.cs (1)
248
Contracts.
Check
(InputTransformer is ITransformerChainAccessor);
SequentialTransformerBase.cs (2)
667
Contracts.
Check
(IsColumnActive(column));
683
Contracts.
Check
(index < _getters.Length);
SrCnnEntireAnomalyDetector.cs (1)
159
Contracts.
Check
(iinfo == 0);
Microsoft.ML.Transforms (32)
CountFeatureSelection.cs (1)
432
Contracts.
Check
(value.Length == size);
Dracula\CountTable.cs (4)
51
Contracts.
Check
(priorCounts.All(x => x >= 0));
52
Contracts.
Check
(priorCounts.Length == labelCardinality);
58
Contracts.
Check
(garbageCounts.Length == labelCardinality);
59
Contracts.
Check
(garbageCounts.All(x => x >= 0));
Dracula\CountTableBuilder.cs (1)
60
Contracts.
Check
(0 <= labelKey && labelKey < LabelCardinality);
Dracula\DictCountTable.cs (1)
118
Contracts.
Check
(counts.Length == LabelCardinality);
HashJoiningTransform.cs (1)
130
Contracts.
Check
(NumBitsMin <= numberOfBits && numberOfBits < NumBitsLim);
Text\LdaSingleBox.cs (24)
138
Contracts.
Check
(numTopic >= 0);
139
Contracts.
Check
(numVocab >= 0);
140
Contracts.
Check
(tableSize >= 0);
141
Contracts.
Check
(aliasTableSize >= 0);
147
Contracts.
Check
(docNum >= 0);
148
Contracts.
Check
(corpusSize >= 0);
167
Contracts.
Check
(numBurninIter >= 0);
197
Contracts.
Check
(numVocab == NumVocab);
198
Contracts.
Check
(termNum > 0);
199
Contracts.
Check
(termID.Length >= termNum);
200
Contracts.
Check
(termVal.Length >= termNum);
212
Contracts.
Check
(numVocab == NumVocab);
213
Contracts.
Check
(termNum > 0);
215
Contracts.
Check
(termVal.Length >= termNum);
263
Contracts.
Check
(termNum > 0);
264
Contracts.
Check
(termVal.Length >= termNum);
265
Contracts.
Check
(termID.Length >= termNum);
282
Contracts.
Check
(false);
294
Contracts.
Check
(termNum > 0);
295
Contracts.
Check
(numBurninIter > 0);
296
Contracts.
Check
(termVal.Length >= termNum);
315
Contracts.
Check
(false);
359
Contracts.
Check
(termID >= 0);
360
Contracts.
Check
(topicNum <= NumTopic);