1544 references to Assert
Microsoft.ML.Core (20)
Data\ModelLoading.cs (7)
93env.Assert(ent.Stream.Position == 0); 103env.Assert(ent.Stream.Position == 0); 163env.Assert(fp == ctx.FpMin); 244_ectx.Assert(Reader.BaseStream.Position == FpMin + Header.FpModel); 263_ectx.Assert(Reader.BaseStream.Position == FpMin + Header.FpModel); 277_ectx.Assert(Reader.BaseStream.Position == FpMin + Header.FpModel); 316_ectx.Assert(ent.Stream.Position == 0);
Data\ModelSaveContext.cs (1)
250_ectx.Assert((_ent == null) == !InRepository);
Data\ProgressReporter.cs (5)
381_ectx.Assert(entry == null); 411_ectx.Assert(entry == null); 416_ectx.Assert(entry != null); 417_ectx.Assert(kind == ProgressEvent.EventKind.Progress); 418_ectx.Assert(!info.IsFinished);
Data\Repository.cs (5)
151_ectx.Assert(!Disposed); 236_ectx.Assert(!Disposed); 274_ectx.Assert(!Disposed); 351ExceptionContext.Assert(!Disposed); 382ExceptionContext.Assert(!Disposed);
Data\ServerChannel.cs (2)
121_chp.Assert((_toPublish == null) == (_onPublish == null)); 132_chp.Assert((_onPublish == null) == (_toPublish == null));
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
3176Env.Assert(Utils.Size(xfNames) == Utils.Size(xfArgs));
Microsoft.ML.Data (726)
Commands\CrossValidationCommand.cs (4)
237ch.Assert(perInstance.Length == 1); 478host.Assert(0 <= fold && fold <= _numFolds); 500ch.Assert(!testFilter.Complement); 509ch.Assert(_applyTransformsToValidationData != null);
Commands\DataCommand.cs (1)
383Host.Assert(!string.IsNullOrWhiteSpace(ImplOptions.InputModelFile));
Commands\ScoreCommand.cs (2)
157ch.Assert(writer != null); 182ch.Assert(outputAllColumns || maxScoreId > 0); // score set IDs are one-based
Commands\TrainCommand.cs (1)
279ch.Assert(validData == null || trainer.Info.SupportsValidation);
Commands\TypeInfoCommand.cs (4)
108ch.Assert(isIdentity); 124ch.Assert(Utils.Size(dsts) >= 1); 125ch.Assert(Utils.Size(srcs) >= 1); 144ch.Assert(type.IsStandardScalar());
Data\DataViewUtils.cs (27)
120host.Assert(cthd > 0); 373ch.Assert(localCursor.Position < 0); 430ch.Assert(count == 0 || localCursor.Batch > oldBatch); 512ch.Assert(input.Schema == _schema); 513ch.Assert(cthd >= 2); 514ch.Assert(AllCacheable(_schema, input.IsColumnActive)); 536ch.Assert(0 <= activeToCol[c] && activeToCol[c] < _schema.Count); 537ch.Assert(c == 0 || activeToCol[c - 1] < activeToCol[c]); 539ch.Assert(input.IsColumnActive(column)); 540ch.Assert(column.Type.IsCacheable()); 611ch.Assert(remaining >= 0); 1037Ch.Assert(colToActive.Length == schema.Count); 1038Ch.Assert(activeToCol.Length + (int)ExtraIndex._Lim == pipes.Length); 1039Ch.Assert(pipes.All(p => p != null)); 1072Ch.Assert(!_disposed); 1079Ch.Assert(pipe.Remaining == _remaining); 1095Ch.Assert(nextBatch.HasException || nextBatch.BatchId > Batch); 1096Ch.Assert(nextBatch.HasException || nextBatch.Count > 0); 1102Ch.Assert(!nextBatch.HasException); 1206Ch.Assert(cursor.Position < 0); 1255Ch.Assert(col < cursor.Schema.Count); 1256Ch.Assert(cursor.IsColumnActive(Schema[col])); 1257Ch.Assert(type.Equals(cursor.Schema[col].Type)); 1271Ch.Assert(!_disposed); 1280Ch.Assert(_currentCursor.Batch > _batch); 1290Ch.Assert(Position < 0 || stats.Batch > _batch); 1294Ch.Assert(stats.Batch == _currentCursor.Batch);
Data\RowCursorUtils.cs (3)
520_host.Assert(Enumerable.Range(0, row.Schema.Count).All(c => row.IsColumnActive(row.Schema[c]))); 556Ch.Assert(active.Length == parent.Schema.Count); 592Ch.Assert(_parent._row.IsColumnActive(column));
Data\SlotCursor.cs (2)
135Ch.Assert(_slotIndex >= 0); 141Ch.Assert(_slotIndex < 0);
DataLoadSave\Binary\BinaryLoader.cs (47)
147_ectx.Assert(0 <= index && index < parent._header.ColumnCount); 150_ectx.Assert(metadataTocOffset == 0 || Header.HeaderSize <= metadataTocOffset); 152_ectx.Assert(Header.HeaderSize <= lookupOffset); 166_ectx.Assert(!IsGenerated); 194_ectx.Assert(IsGenerated); 205_ectx.Assert(IsGenerated); 219_ectx.Assert(IsGenerated); 220_ectx.Assert(typeof(T) == Type.RawType); 230_ectx.Assert(!IsGenerated == (LookupOffset > 0)); 273_ectx.Assert(_maxDecompLen >= 0); 274_ectx.Assert(_maxCompLen >= 0); 293_ectx.Assert(0 <= _maxCompLen); 294_ectx.Assert(0 <= _maxDecompLen); 388_ectx.Assert((MetadataTocOffset == 0) == (_metadataToc == null)); 389_ectx.Assert((MetadataTocOffset == 0) == (_deadMetadataToc == null)); 402_ectx.Assert((MetadataTocOffset == 0) == (_metadataToc == null)); 403_ectx.Assert((MetadataTocOffset == 0) == (_deadMetadataToc == null)); 416_ectx.Assert(MetadataTocOffset == 0); 433_ectx.Assert((_metadataTocEnd == 0) == (MetadataTocOffset == 0)); 503ectx.Assert(Enum.IsDefined(typeof(CompressionKind), compression)); 510ectx.Assert(valueType.IsGenericEx(typeof(VBuffer<>))); 512ectx.Assert(args.Length == 1); 786_host.Assert(_outputSchema.Count == Utils.Size(_aliveColumns)); 874ch.Assert(_outputSchema.Count == Utils.Size(_aliveColumns)); 908h.Assert(retVal == null); 946_host.Assert(_threads >= 1); 951_host.Assert(Utils.Size(unsavable) == 0); 984h.Assert(noRows.GetRowCount() == 0); 1172ch.Assert(poolSize >= 0); 1464Ectx.Assert(0 <= columnIndex && columnIndex < Utils.Size(parent._actives)); 1568Ectx.Assert(entry.IsGenerated); 1572Ectx.Assert(bufferSize > 0); 1607Ectx.Assert(!_toRead.IsAddingCompleted); 1632Ectx.Assert(_remaining >= 0); 1633Ectx.Assert(_remaining == 0 || _curr != null); 1644Ectx.Assert(_remaining > 0); 1772Ectx.Assert(bufferSize > 0); 1776Ectx.Assert(!entry.IsGenerated); 1778Ectx.Assert(entry.Codec is IValueCodec<T>); 1779Ectx.Assert(Enum.IsDefined(typeof(CompressionKind), entry.Compression)); 1975Ch.Assert(!_disposed); 2011Ch.Assert(more == pipeMoved); 2090Ch.Assert(pos / _rowsPerBlock < _blockShuffleOrder.Length); 2093Ch.Assert(0 <= blockPos && blockPos < _parent.RowCount); 2177ch.Assert(col.ColumnIndex == colCount); // *Every* column in the file should be here, even if dead. 2206ch.Assert(deadMtoc == null && col.MetadataTocOffset == 0); 2221ch.Assert(colCount == header.ColumnCount);
DataLoadSave\Binary\BinarySaver.cs (19)
219_host.Assert(columns > 0); 220_host.Assert(_deterministicBlockOrder == (waiter != null)); 265_host.Assert(0 <= col && col < schema.Count); 344_host.Assert(metadataInfos.Count == offsets.Count - 1); 352_host.Assert(typeof(T) == type.RawType); 375_host.Assert(tmp); 388_host.Assert(tmp); 407cp.Assert(rowsPerBlock > 0); 429ch.Assert(tmp); 451ch.Assert(lookups.Count == block.BlockIndex); 458ch.Assert(lookups[blockIndex].BlockOffset == 0); 476ch.Assert(deadLookups[c] == 0); 487ch.Assert(lookup.BlockOffset > 0); 581ch.Assert(rowsPerBlock > 0); 659ch.Assert(rowsPerBlock > 0); 692_host.Assert(compressionTask != null || toCompress.IsCompleted); 722_host.Assert(type.Equals(codec.Type)); 733_host.Assert(_maxRowsPerBlock.HasValue && _maxRowsPerBlock.Value > 0); // argument validation should have ensured this 904_host.Assert(typeof(T) == codec.Type.RawType);
DataLoadSave\Database\DatabaseLoaderCursor.cs (3)
38Ch.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count); 52Ch.Assert(_getters[i] != null); 181Ch.Assert(colInfo.ColType.RawType == typeof(TValue));
DataLoadSave\LegacyCompositeDataLoader.cs (2)
309h.Assert(!(loader is LegacyCompositeDataLoader)); 489host.Assert(tagData.Count == acceptedIds.Count);
DataLoadSave\Text\TextLoader.cs (14)
725ch.Assert(0 <= inputSize && inputSize < SrcLim); 742ch.Assert(min <= max); 782ch.Assert(Utils.Size(col.Source) > 0); 809ch.Assert(!seg.IsVariable); 813ch.Assert(needInputSize && 0 < inputSize && inputSize < SrcLim); 817ch.Assert(!seg.IsVariable); 822ch.Assert(seg.IsVariable); 827ch.Assert(!seg.IsVariable); 845ch.Assert(0 <= isegOther && isegOther < segsOther.Length); 878ch.Assert(min < lim); 1179_host.Assert(Utils.Size(cols) > 0); 1353ch.Assert(h.Loader == null || h.Loader is ICommandLineComponentFactory); 1518_host.Assert((_flags & ~OptionFlags.All) == 0); 1520_host.Assert(0 <= _inputSize && _inputSize < SrcLim);
DataLoadSave\Text\TextLoaderCursor.cs (8)
89Ch.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count); 92Ch.Assert(srcNeeded >= 0); 93Ch.Assert(cthd > 0); 118Ch.Assert(v != null); 120Ch.Assert(_getters[i] != null); 333Ch.Assert(_rows.Count == 1); 339Ch.Assert(batch.Exception == null); 343Ch.Assert(info.Line > 0);
DataLoadSave\Text\TextLoaderParser.cs (2)
157_ch.Assert(cref > 0); 165_ch.Assert(n >= 0);
DataLoadSave\Transpose\TransposeLoader.cs (27)
246Host.Assert(rowCountNull.HasValue); 273Host.Assert(0 <= col && col < parent.Schema.Count); 308Host.Assert(rowCountNull.HasValue); 476_host.Assert(_schemaEntry.GetViewOrNull() == schemaView); 481_host.Assert(_entries[c].GetViewOrNull() == null); 483_host.Assert(HasRowData); 511h.Assert(schemaView == null); 528_host.Assert(_threads >= 0); 546env.Assert(noRows.GetRowCount() == 0); 553env.Assert(Enumerable.Range(0, schema.Count).All(c => saver.IsColumnSavable(schema[c].Type))); 681Ch.Assert(cursor.Schema.Count == 1); 682Ch.Assert(cursor.Schema[0].Type.RawType == typeof(VBuffer<T>)); 683Ch.Assert(cursor.Schema[0].Type is VectorDataViewType); 720_host.Assert(0 <= col && col < _header.ColumnCount); 722_host.Assert(!HasRowData); 733_host.Assert(view.Schema.Count == 1); 736_host.Assert(trans.Schema.Count == 1); 738_host.Assert((trans as ITransposeDataView)?.GetSlotType(0).GetValueCount() == Schema[col].Type.GetValueCount()); 768Ch.Assert(!_parent.HasRowData); 796Ch.Assert(0 <= col && col < Schema.Count); 797Ch.Assert(_colToActivesIndex[col] >= 0); 799Ch.Assert(((ITransposeDataView)_parent).GetSlotType(col).Size == _parent._header.RowCount); 814Ch.Assert(typeof(T) == type.RawType); 823Ch.Assert(buff.Length == 1); 834Ch.Assert(type is VectorDataViewType); 835Ch.Assert(typeof(T) == type.GetItemType().RawType); 861Ch.Assert(cMore == more);
DataLoadSave\Transpose\TransposeSaver.cs (3)
106ch.Assert(stream.CanSeek); 164ch.Assert(offsets.Count == cols.Length + 2); 165ch.Assert(offsets[offsets.Count - 1] == stream.Position);
DataView\AppendRowsDataView.cs (11)
75_host.Assert(sources.Length >= 2); 258Ch.Assert(0 <= _currentSourceIndex && _currentSourceIndex < Sources.Length); 259Ch.Assert(_currentCursor != null); 320Ch.Assert(Sources.Length == counts.Length); 324Ch.Assert(counts[i] >= 0); 355Ch.Assert(0 <= _currentSourceIndex && _currentSourceIndex < Sources.Length); 371Ch.Assert(pos < _cursorSet.Length); 374Ch.Assert(r); 421_ectx.Assert(Utils.Size(counts) > 0); 427context.Assert(count >= 0 && _totalLeft + count >= _totalLeft); 466_ectx.Assert(_batchEnd > 0);
DataView\ArrayDataViewBuilder.cs (6)
214_host.Assert(rowCount >= 0); 215_host.Assert(builder._names.Count == builder._columns.Count); 270Ch.Assert(view.Schema.Count >= 0); 344Ch.Assert(Position < _view._rowCount); 350Ch.Assert(IsGood); 351Ch.Assert(0 <= Position && Position < _view._rowCount);
DataView\BatchDataViewMapperBase.cs (3)
122Ch.Assert(getter != null); 156Ch.Assert(_lastInBatchInLookAheadCursorDel()); 161Ch.Assert(good);
DataView\CacheDataView.cs (31)
135env.Assert(ip == prefetch.Length || c <= prefetch[ip]); 161env.Assert(ip == prefetch.Length || c < prefetch[ip]); 163env.Assert(ip == prefetch.Length); 187_host.Assert(-1 <= result && result < _subsetInput.Schema.Count); 236_host.Assert(rc >= 0); 276_host.Assert(n > 1); 306_host.Assert(_rowCount >= 0); 476Ch.Assert(Position >= 0); 481Ch.Assert(Position == -1); 1175Ch.Assert(_colToActivesIndex[c] == ic); 1219Ch.Assert(0 <= col && col < _colToActivesIndex.Length); 1220Ch.Assert(_colToActivesIndex[col] >= 0); 1226Ch.Assert(0 <= col && col < _colToActivesIndex.Length); 1227Ch.Assert(_colToActivesIndex[col] >= 0); 1228Ch.Assert(Schema[col].Type.RawType == typeof(TValue)); 1284host.Assert(0 <= srcCol && srcCol < input.Schema.Count); 1285host.Assert(input.IsColumnActive(input.Schema[srcCol])); 1293host.Assert(type is PrimitiveDataViewType); 1351Ctx.Assert(type is VectorDataViewType); 1360Ctx.Assert(0 <= _rowCount && _rowCount < int.MaxValue); 1367Ctx.Assert(_uniformLength == 0 || _uniformLength == _temp.Length); 1387Ctx.Assert(0 <= idx); 1388Ctx.Assert((idx + 1) < Utils.Size(_indexBoundaries)); 1389Ctx.Assert((idx + 1) < Utils.Size(_valueBoundaries)); 1390Ctx.Assert(_uniformLength > 0 || idx < Utils.Size(_lengths)); 1392Ctx.Assert(_indexBoundaries[idx + 1] - _indexBoundaries[idx] <= int.MaxValue); 1394Ctx.Assert(_valueBoundaries[idx + 1] - _valueBoundaries[idx] <= int.MaxValue); 1396Ctx.Assert(valueCount == indexCount || indexCount == 0); 1397Ctx.Assert(0 <= indexCount && indexCount <= valueCount); 1399Ctx.Assert(valueCount <= len); 1400Ctx.Assert(valueCount == len || indexCount == valueCount);
DataView\DataViewConstructionUtils.cs (13)
223Host.Assert(schema.Count == schemaDef.Columns.Length); 224Host.Assert(schema.Count == peeks.Length); 243Host.Assert(vectorType != null); 248Host.Assert(vectorType.ItemType is TextDataViewType); 254Host.Assert(Nullable.GetUnderlyingType(outputType.GetElementType()) == vectorType.ItemType.RawType); 256Host.Assert(outputType.GetElementType() == vectorType.ItemType.RawType); 264Host.Assert(outputType.IsGenericType); 265Host.Assert(outputType.GetGenericTypeDefinition() == typeof(VBuffer<>)); 266Host.Assert(outputType.GetGenericArguments()[0] == vectorType.ItemType.RawType); 275Host.Assert(colType is TextDataViewType); 281Host.Assert(colType.RawType == Nullable.GetUnderlyingType(outputType)); 283Host.Assert(colType.RawType == outputType); 676Ch.Assert(Position < _data.Count);
DataView\LambdaColumnMapper.cs (5)
111Host.Assert(typeDst.RawType == typeof(T3)); 113Host.Assert(map2 != null || typeof(T2) == typeof(T3)); 132Host.Assert(vectorSize > 0); 150Host.Assert(iinfo == 0); 158Host.Assert(iinfo == 0);
DataView\LambdaFilter.cs (3)
90Host.Assert(conv != null || typeof(T1) == typeof(T2)); 91Host.Assert(0 <= colSrc && colSrc < Source.Schema.Count); 167Ch.Assert(typeof(T1) == typeof(T2));
DataView\RowToRowMapperTransform.cs (1)
404Ch.Assert(getter != null);
DataView\Transposer.cs (36)
148ch.Assert(Enumerable.Range(0, slicerSchema.Count).All(c => saver.IsColumnSavable(slicerSchema[c].Type))); 160ch.Assert(min < lim); 186ch.Assert(rowCount >= 0); 247_host.Assert(0 <= tcol && tcol < _cols.Length); 248_host.Assert(_cols[tcol].Index == col); 273_host.Assert(elementType != null); 309Ch.Assert(0 <= col && col < parent.Schema.Count); 327Ch.Assert(0 <= _col && _col < _parent.Schema.Count); 344Ch.Assert(0 <= col && col < parent.Schema.Count); 346Ch.Assert(iinfo >= 0); 358Ch.Assert(parent._splitLim[iinfo] - _col == 1); 361Ch.Assert(_view.Schema[_col].Type is PrimitiveDataViewType); 362Ch.Assert(_view.Schema[_col].Type.RawType == typeof(T)); 395Ch.Assert(len <= _len); 405Ch.Assert(len == _len); 475Ch.Assert(iinfo >= 0); 513Ch.Assert(_slotCurr >= 0); 519Ch.Assert(itemType.RawType == typeof(T)); 521Ch.Assert(vecLen > 0); 601Ch.Assert(heap.Count == 0); 617Ch.Assert(pair.Key > s); 626Ch.Assert(rbuff.IsDense || rbuffIndices[ii] == s); 641Ch.Assert(0 <= idx && idx < _len); 649Ch.Assert(offset == _len); 670Ch.Assert(_indices[s].Length == _len); 671Ch.Assert(_values[s].Length == _len); 686Ch.Assert(_slotCurr == _slotLim); 691Ch.Assert(_slotLim > 0); 699Ch.Assert(0 <= _slotCurr && _slotCurr < Utils.Size(_cbuff) && _cbuff[_slotCurr].Buffer.Length == _len); 757_host.Assert(splitter.ColumnCount >= 1); 787_host.Assert(outputColumnCount == _colToSplitIndex.Length); 813_host.Assert(0 <= incol && incol < _incolToLim.Length); 826_host.Assert(0 <= col && col < _colToSplitIndex.Length); 1274Ch.Assert(Utils.Size(activeSplitters) == slicer._splitters.Length); 1375ctx.Assert(genTypeArgs.Length == 1); 1445_host.Assert(valueCount > 0);
DataView\TypedCursor.cs (14)
123_host.Assert(_columns.Length == _columnIndices.Length); 343Ch.Assert(n == parent._columns.Length); 344Ch.Assert(n == parent._columnIndices.Length); 364Ch.Assert(colType is VectorDataViewType); 368Ch.Assert(colType.GetItemType() is TextDataViewType); 374Ch.Assert(colType.GetItemType().RawType == Nullable.GetUnderlyingType(fieldType.GetElementType())); 376Ch.Assert(colType.GetItemType().RawType == fieldType.GetElementType()); 384Ch.Assert(fieldType.IsGenericType); 385Ch.Assert(fieldType.GetGenericTypeDefinition() == typeof(VBuffer<>)); 386Ch.Assert(fieldType.GetGenericArguments()[0] == vectorType.ItemType.RawType); 395Ch.Assert(colType is TextDataViewType); 396Ch.Assert(peek == null); 402Ch.Assert(colType.RawType == Nullable.GetUnderlyingType(fieldType)); 404Ch.Assert(colType.RawType == fieldType);
DataView\ZipDataView.cs (1)
50_host.Assert(Utils.Size(sources) > 1);
Dirty\ChooseColumnsByIndexTransform.cs (1)
287Ch.Assert(active == null || active.Length == bindings.OutputSchema.Count);
EntryPoints\EntryPointNode.cs (16)
223ectx.Assert(IsValidType(type)); 233_ectx.Assert(!IsValueSet); 234_ectx.Assert(value == null || Type.IsAssignableFrom(value.GetType())); 543ch.Assert(colFieldType == typeof(string)); 545ch.Assert(inputColName is string || inputColName is Optional<string>); 574env.Assert(success); 601env.Assert(success); 795_host.Assert(CanStart()); 803_host.Assert(success); 806_host.Assert(_inputBuilder.GetMissingValues().Length == 0); 826_host.Assert(good); 854_host.Assert(bindings.Skip(1).All(binding => binding.GetType().Equals(firstBinding.GetType()))); 858_host.Assert(bindings.Count == 1); 877_host.Assert(false); 943_host.Assert(success && variableBinding != null); 1013_host.Assert(_nodes.Contains(node));
EntryPoints\InputBuilder.cs (6)
84_ectx.Assert(fields.Count == attrs.Count); 456ectx.Assert(false); 469ectx.Assert(false); 476ectx.Assert(false); 636ectx.Assert(genericType == typeof(Nullable<>)); 685_ectx.Assert(fields.Count == attrs.Count);
EntryPoints\TransformModelImpl.cs (2)
231_ectx.Assert(IsCompositeRowToRowMapper(_chain)); 249_ectx.Assert(IsCompositeRowToRowMapper(_chain));
Evaluators\AnomalyDetectionEvaluator.cs (10)
452Host.Assert(topK > 0); 453Host.Assert(nameIndex == -1 || nameIndex >= 0); 454Host.Assert(k > 0); 480Host.Assert(!_streaming && PassNum < 2 || PassNum < 1); 504Host.Assert(!_streaming && PassNum < 2 || PassNum < 1); 505Host.Assert(schema.Label.HasValue); 516Host.Assert(_topExamples.Count == 0); 602Host.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics)); 609Host.Assert(moved); 612Host.Assert(!moved);
Evaluators\BinaryClassifierEvaluator.cs (35)
162Host.Assert(prob == null || prob.Count == 1); 574Host.Assert(Utils.Size(classNames) == 2); 575Host.Assert(aucReservoirSize >= -1); 576Host.Assert(prCount >= 0); 577Host.Assert(auPrcReservoirSize >= 0); 578Host.Assert(useRaw || 0 <= threshold && threshold <= 1); 622Host.Assert(schema.Label.HasValue); 623Host.Assert(PassNum < 1); 633Host.Assert(prob == null || prob.Count == 1); 640Host.Assert((schema.Weight != null) == Weighted); 679Host.Assert((_weightGetter != null) == Weighted); 825Host.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics)); 833Host.Assert(moved); 836Host.Assert(!moved); 873Host.Assert(resultDict.ContainsKey(MetricKinds.PrCurve)); 875Host.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics)); 899Host.Assert(moved); 902Host.Assert(!moved); 919Host.Assert(thresholdColumn != null); 920Host.Assert(precisionColumn != null); 921Host.Assert(recallColumn != null); 922Host.Assert(fprColumn != null); 952Host.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics)); 960Host.Assert(moved); 963Host.Assert(!moved); 998Host.Assert(resultDict.ContainsKey(MetricKinds.PrCurve)); 1000Host.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics)); 1024Host.Assert(moved); 1027Host.Assert(!moved); 1144Host.Assert(_useRaw); 1150Host.Assert(LabelIndex >= 0); 1151Host.Assert(ScoreIndex >= 0); 1152Host.Assert(_probIndex >= 0 || _useRaw); 1274Host.Assert(!string.IsNullOrEmpty(_probCol)); 1398ch.Assert(string.IsNullOrEmpty(weightedConf) == string.IsNullOrEmpty(weightedFold));
Evaluators\ClusteringEvaluator.cs (15)
82Host.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics)); 89Host.Assert(moved); 92Host.Assert(!moved); 116Host.Assert(schema.Feature.HasValue); 130Host.Assert(!_calculateDbi || schema.Feature != null); 137Host.Assert(!_calculateDbi || schema.Feature?.Type.IsKnownSizeVector() == true); 140Host.Assert(scoreType != null && scoreType.Size > 0); 410Host.Assert(features.HasValue); 496Host.Assert(schema.Feature.HasValue); 500Host.Assert(score.Type.GetVectorSize() == _scoresArr.Length); 514Host.Assert(PassNum == 1 && _calculateDbi); 543Host.Assert(IsActive()); 551Host.Assert(!_calculateDbi || _featGetter != null); 555Host.Assert(PassNum == 1 && _calculateDbi); 637Host.Assert(_numClusters > 0);
Evaluators\EvaluatorBase.cs (1)
296Host.Assert(PassNum < 1);
Evaluators\EvaluatorUtils.cs (9)
137ectx.Assert(ReadOnlyMemoryUtils.EqualsStr(kind, tmp)); 401env.Assert(inputCol < input.Schema.Count); 443env.Assert(inputCol < input.Schema.Count); 996ch.Assert(Utils.Size(getters) == schema.Count); 997ch.Assert(Utils.Size(vBufferGetters) == schema.Count); 1047ch.Assert(metricNames.Count == metricCount); 1088env.Assert(hasStrats == hasStratVals); 1299env.Assert(vectorMetrics.Length > 0); 1394host.Assert(type != null && type.IsKnownSize && type.ItemType is TextDataViewType);
Evaluators\Metrics\ConfusionMatrix.cs (3)
77_host.Assert(precision.Length == confusionTableCounts.Length); 78_host.Assert(recall.Length == confusionTableCounts.Length); 79_host.Assert(labelNames.Count == confusionTableCounts.Length);
Evaluators\MulticlassClassificationEvaluator.cs (16)
91Host.Assert(numClasses > 0); 112Host.Assert(Utils.Size(score) == 1); 114Host.Assert(numClasses > 0); 400Host.Assert(outputTopKAcc == null || outputTopKAcc > 0); 401Host.Assert(scoreVectorSize > 0); 402Host.Assert(Utils.Size(classNames) == scoreVectorSize); 414Host.Assert(PassNum < 1); 415Host.Assert(schema.Label.HasValue); 418Host.Assert(score.Type.GetVectorSize() == _scoresArr.Length); 563Host.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics)); 571Host.Assert(moved); 574Host.Assert(!moved); 689Host.Assert(_numClasses > 0); 697Host.Assert(ScoreIndex >= 0); 698Host.Assert(LabelIndex >= 0); 942ch.Assert(string.IsNullOrEmpty(weightedConf) == string.IsNullOrEmpty(weightedFold));
Evaluators\MultiOutputRegressionEvaluator.cs (7)
74Host.Assert(vectorSize > 0); 292Host.Assert(size > 0); 462Host.Assert(LabelIndex >= 0); 463Host.Assert(ScoreIndex >= 0); 674ch.Assert(hasStrats == hasStratVals); 754ch.Assert(metricVals.Length == labelCount); 765ch.Assert(foundUnweighted && foundWeighted);
Evaluators\QuantileRegressionEvaluator.cs (7)
51Host.Assert(quantiles.IsDense && quantiles.Length == scoreSize); 72Host.Assert(scoreType != null && scoreType.Size > 0 && (scoreType.ItemType == NumberDataViewType.Single || scoreType.ItemType == NumberDataViewType.Double)); 223Host.Assert(size > 0); 224Host.Assert(slotNames.Length == 0 || slotNames.Length == size); 338Host.Assert(_scoreSize > 0); 382Host.Assert(LabelIndex >= 0); 383Host.Assert(ScoreIndex >= 0);
Evaluators\RankingEvaluator.cs (5)
265Host.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics)); 272Host.Assert(moved); 275Host.Assert(!moved); 440Host.Assert(truncationLevel > 0); 741Host.Assert(0 < _truncationLevel);
Evaluators\RegressionEvaluator.cs (5)
184Host.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics)); 191Host.Assert(moved); 194Host.Assert(!moved); 271Host.Assert(LabelIndex >= 0); 272Host.Assert(ScoreIndex >= 0);
Model\Pfa\BoundPfaContext.cs (4)
84_host.Assert(_nameToVarName.Count == fields.Count); 85_host.Assert(_nameToVarName.Count == fieldNames.Count); 168_host.Assert(0 <= col && col < schema.Count); 245_host.Assert(!Pfa.ContainsCell(cellName));
Model\Pfa\SavePfaCommand.cs (3)
143Host.Assert(transforms.Count == 0 || transforms.Last.Value == end); 163Host.Assert(scorePipe.Source == end); 183Host.Assert(trans.CanSavePfa);
Prediction\Calibrator.cs (18)
219Host.Assert(predictor is IPredictorProducing<float>); 350Host.Assert(_mapper is ISingleCanSavePfa); 384Host.Assert(_mapper is ISingleCanSaveOnnx); 484Host.Assert(predictor is IPredictorWithFeatureWeights<float>); 561Host.Assert(predictor is IPredictorWithFeatureWeights<float>); 1887ch.Assert(stack.Count == 0 || di.Score >= top.MaxX); 1897ch.Assert(stack.Count == 0 || top.MaxX < curr.MinX); 1981_host.Assert(Utils.IsMonotonicallyIncreasing(mins)); 1982_host.Assert(Utils.IsMonotonicallyIncreasing(maxes)); 1983_host.Assert(Utils.IsMonotonicallyIncreasing(values)); 1984_host.Assert(values.Length == 0 || (0 <= values[0] && values[values.Length - 1] <= 1)); 1985_host.Assert(mins.Zip(maxes, (min, max) => min <= max).All(x => x)); 2064_host.Assert(Mins.Length == Maxes.Length); 2065_host.Assert(Mins.Length == Values.Length); 2071_host.Assert(Mins[i] <= Maxes[i]); 2072_host.Assert(Mins[i] > maxPrev); 2073_host.Assert(Values[i] > valuePrev || Values[i] == valuePrev && i == 0); 2115_host.Assert(pos < p);
Prediction\CalibratorCatalog.cs (2)
104Host.Assert(success); 318Host.Assert(input.IsColumnActive(input.Schema[_scoreColIndex]));
Scorers\BinaryClassifierScorer.cs (8)
110env.Assert(mapper is ISchemaBoundRowMapper); 111env.Assert(trainSchema.Label.HasValue); 187Host.Assert(Bindable is IBindableCanSaveOnnx); 188Host.Assert(Bindings.InfoCount >= 2); 193Host.Assert(delta == 1); 220Host.Assert(predictedLabelCol.HasValue); 235Host.Assert(output.Schema == Bindings.RowMapper.OutputSchema); 236Host.Assert(output.IsColumnActive(output.Schema[Bindings.ScoreColumnIndex]));
Scorers\FeatureContributionCalculation.cs (3)
216_env.Assert(0 <= index && index < slotNames.Length); 254_env.Assert(sb.Length >= 2); 319_env.Assert(schema.Feature.HasValue);
Scorers\GenericScorer.cs (6)
213Host.Assert(Bindable is IBindableCanSavePfa); 217Host.Assert(_bindings.DerivedColumnCount == 0); 228Host.Assert(Bindable is IBindableCanSaveOnnx); 232Host.Assert(_bindings.DerivedColumnCount == 0); 267Host.Assert(_bindings.DerivedColumnCount == 0); 270Host.Assert(output.Schema == _bindings.RowMapper.OutputSchema);
Scorers\MulticlassClassificationScorer.cs (5)
245env.Assert(getter is ValueGetter<VBuffer<T>>); 490env.Assert(mapper is ISchemaBoundRowMapper); 495env.Assert(type is VectorDataViewType); 565Host.Assert(output.Schema == Bindings.RowMapper.OutputSchema); 566Host.Assert(output.IsColumnActive(output.Schema[Bindings.ScoreColumnIndex]));
Scorers\PredictedLabelScorerBase.cs (8)
339Host.Assert(Bindable is IBindableCanSavePfa); 344Host.Assert(delta == 1); 372Host.Assert(Bindable is IBindableCanSaveOnnx); 378Host.Assert(delta == 1); 406Host.Assert(Bindings.DerivedColumnCount == 1); 409Host.Assert(output.Schema == Bindings.RowMapper.OutputSchema); 410Host.Assert(Bindings.InfoCount == output.Schema.Count + 1); 419Host.Assert(output.IsColumnActive(output.Schema[Bindings.ScoreColumnIndex]));
Scorers\RowToRowScorerBase.cs (3)
247Ch.Assert(active.Length == _bindings.ColumnCount); 253Ch.Assert(_output.Schema == _bindings.RowMapper.OutputSchema); 300Ch.Assert(getter != null);
Training\TrainerEstimatorBase.cs (1)
136Host.Assert(LabelColumn.IsValid);
Training\TrainerUtils.cs (1)
413_env.Assert(trainer is ITrainer);
Transforms\BindingsWrappedRowCursor.cs (1)
60Ch.Assert(isSrc);
Transforms\BootstrapSamplingTransformer.cs (2)
149Host.Assert(_poolSize >= 0); 236Ch.Assert(_remaining >= 0);
Transforms\ColumnConcatenatingEstimator.cs (1)
77_host.Assert(col.IsValid);
Transforms\ColumnCopying.cs (1)
216Host.Assert(0 <= iinfo && iinfo < _columns.Length);
Transforms\ColumnSelecting.cs (1)
545_host.Assert(0 <= outputIndex && outputIndex < OutputToInputMap.Length);
Transforms\GenerateNumberTransform.cs (3)
443Ch.Assert(originFn != null); 462Ch.Assert(lastCounter <= Input.Position); 475Ch.Assert(!_bindings.UseCounter[iinfo]);
Transforms\Hashing.cs (15)
236Host.Assert(types[iinfo].GetItemType().GetKeyCount() > 0); 238Host.Assert(disposer == null); 253Host.Assert(_keyValues[invertIinfos[i]].Length == types[invertIinfos[i]].GetItemType().GetKeyCountAsInt32(Host)); 264Host.Assert(0 <= iinfo && iinfo < _columns.Length); 311Host.Assert(_columns.Length == ColumnPairs.Length); 352Host.Assert(HashingEstimator.IsColumnTypeValid(srcType)); 369Host.Assert(srcType.RawType == typeof(byte)); 398Host.Assert(srcType.RawType == typeof(bool)); 404Host.Assert(HashingEstimator.IsColumnTypeValid(srcType.ItemType)); 416Host.Assert(rawType == typeof(ulong)); 445Host.Assert(srcType.ItemType == TextDataViewType.Instance); 452Host.Assert(srcType.ItemType.RawType == typeof(T)); 466Host.Assert(HashingEstimator.IsColumnTypeValid(srcType)); 481Host.Assert(rawType == typeof(byte)); 510Host.Assert(rawType == typeof(bool));
Transforms\InvertHashUtils.cs (3)
394ch.Assert(result); 396ch.Assert(vectorType.Size == 0); 397ch.Assert(vectorType.ItemType == TextDataViewType.Instance);
Transforms\KeyToValue.cs (12)
215Host.Assert(0 <= iinfo && iinfo < _types.Length); 250Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 255Host.Assert(keyItemType.RawType == typeof(TKey)); 256Host.Assert(valItemType.RawType == typeof(TValue)); 294Parent.Host.Assert(0 <= iinfo && iinfo < Parent._types.Length); 319Parent.Host.Assert(values.IsDense); 320Parent.Host.Assert(typeKey.RawType == typeof(TKey)); 321Parent.Host.Assert(TypeOutput.RawType == typeof(TValue)); 425Parent.Host.Assert(islot < srcCount); 428Parent.Host.Assert(slot < nextExplicitSlot); 432Parent.Host.Assert(slot < nextExplicitSlot); 447Parent.Host.Assert(islotSrc < srcCount);
Transforms\KeyToVector.cs (31)
155Host.Assert(_columns.Length == ColumnPairs.Length); 295Host.Assert(colIndex >= 0); 366Host.Assert(0 <= iinfo && iinfo < _infos.Length); 368Host.Assert(typeSrc != null && typeSrc.IsKnownSize); 372Host.Assert(typeSrc.Size > 1); 390Host.Assert(slotLim == (long)typeSrc.Size * keyCount); 421Host.Assert(slot == slotLim); 428Host.Assert(0 <= iinfo && iinfo < _infos.Length); 433Host.Assert(valueCount > 0); 452Host.Assert(0 <= iinfo && iinfo < _infos.Length); 471Host.Assert(keyTypeSrc != null); 473Host.Assert(size == _types[iinfo].Size); 474Host.Assert(size > 0); 476Host.Assert(srcCol >= 0); 505Host.Assert(srcVectorType != null); 508Host.Assert(keyTypeSrc != null); 509Host.Assert(_parent._columns[iinfo].OutputCountVector); 511Host.Assert(size == _types[iinfo].Size); 512Host.Assert(size > 0); 515Host.Assert(cv >= 0); 517Host.Assert(srcCol >= 0); 551Host.Assert(srcVectorType != null); 554Host.Assert(keyTypeSrc != null); 555Host.Assert(!_parent._columns[iinfo].OutputCountVector); 558Host.Assert(size > 0); 561Host.Assert(cv >= 0); 562Host.Assert(_types[iinfo].Size == size * cv); 582Host.Assert(lenSrc == cntSrc); 585Host.Assert(count < cntSrc); 598Host.Assert(count < cntSrc); 671Host.Assert(keyCount > 0);
Transforms\LabelConvertTransform.cs (2)
185Host.Assert(0 <= iinfo && iinfo < Infos.Length); 198Host.Assert(0 <= iinfo && iinfo < Infos.Length);
Transforms\LabelIndicatorTransform.cs (5)
138Host.Assert(Infos.Length == Utils.Size(options.Columns)); 163Host.Assert(0 <= iinfo && iinfo < Infos.Length); 172ch.Assert(0 <= iinfo && iinfo < Infos.Length); 183ch.Assert(0 <= iinfo && iinfo < Infos.Length); 187ch.Assert(TestIsMulticlassLabel(info.TypeSrc) == null);
Transforms\NAFilter.cs (2)
180Host.Assert(_infos.Length > 0); 420Ch.Assert(IsColumnActive(Schema[col]));
Transforms\NormalizeColumn.cs (9)
486Host.Assert(indicesNonZeroOffset == null || offset != null); 487Host.Assert(Offset == null || Offset.Length == Scale.Length); 608Host.Assert(mean.Length == stddev.Length); 744Host.Assert(Rem >= 0); 779Host.Assert(Rem >= 0); 813Host.Assert(type is KeyDataViewType || type is NumberDataViewType); 817Host.Assert(type.GetKeyCountAsInt32(Host) > 0); 860Host.Assert(Rem >= 0); 917Host.Assert(valueCol.Type.IsKnownSizeVector());
Transforms\NormalizeColumnDbl.cs (11)
678host.Assert(scales.Length == cfeat); 679host.Assert(offsets == null || offsets.Length == cfeat); 680host.Assert(Utils.Size(nz) == 0 || offsets != null); 743host.Assert(scales.Length == cfeat); 744host.Assert(offsets == null || offsets.Length == cfeat); 745host.Assert(Utils.Size(nz) == 0 || offsets != null); 1170Host.Assert(0 <= _offset && _offset <= 1); 1250Host.Assert(0 <= _offset[i] && _offset[i] <= 1); 1627Host.Assert((lim == 0) == (cv == 1)); 1812Host.Assert((lim == 0) == (cv == 1)); 1937Host.Assert(0 <= values.Length && values.Length <= size);
Transforms\NormalizeColumnSng.cs (11)
836host.Assert(scales.Length == cfeat); 837host.Assert(offsets == null || offsets.Length == cfeat); 838host.Assert(Utils.Size(nz) == 0 || offsets != null); 900host.Assert(scales.Length == cfeat); 901host.Assert(offsets == null || offsets.Length == cfeat); 902host.Assert(Utils.Size(nz) == 0 || offsets != null); 1331Host.Assert(0 <= _offset && _offset <= 1); 1411Host.Assert(0 <= _offset[i] && _offset[i] <= 1); 1790Host.Assert((lim == 0) == (cv == 1)); 1975Host.Assert((lim == 0) == (cv == 1)); 2101Host.Assert(0 <= count && count <= size);
Transforms\Normalizer.cs (2)
588env.Assert(!(srcTypes[i] is VectorDataViewType vectorType) || vectorType.IsKnownSize); 589env.Assert(functionBuilders[i] != null);
Transforms\PerGroupTransformBase.cs (3)
305Ch.Assert(getter != null); 337Ch.Assert(good); 339Ch.Assert(_groupCursor.Position >= 0);
Transforms\RangeFilter.cs (11)
193Host.Assert(_min < _max); 245Host.Assert(_type is KeyDataViewType); 357Ch.Assert(Parent._type == NumberDataViewType.Single); 369Ch.Assert(Parent._type == NumberDataViewType.Single); 375Ch.Assert(Parent._type == NumberDataViewType.Single); 390Ch.Assert(Parent._type == NumberDataViewType.Double); 402Ch.Assert(Parent._type == NumberDataViewType.Double); 408Ch.Assert(Parent._type == NumberDataViewType.Double); 425Ch.Assert(Parent._type.GetKeyCount() > 0); 440Ch.Assert(Parent._type is KeyDataViewType); 446Ch.Assert(Parent._type is KeyDataViewType);
Transforms\RowShufflingTransformer.cs (17)
508Ch.Assert(_blockSize > 0); 509Ch.Assert(_bufferDepth > 0); 510Ch.Assert(poolRows > 0); 582Ch.Assert(requested >= _blockSize); 586Ch.Assert(0 <= circularIndex && circularIndex < _pipeIndices.Length); 590Ch.Assert(0 <= pipeIndex && pipeIndex < _pipeIndices.Length); 618Ch.Assert(_liveCount > 0); 619Ch.Assert(_deadCount < _blockSize || _doneConsuming); 620Ch.Assert(0 <= _circularIndex && _circularIndex < _pipeIndices.Length); 672Ch.Assert((_colToActivesIndex[column.Index] >= 0) == _input.IsColumnActive(column)); 678Ch.Assert(0 <= col && col < _colToActivesIndex.Length); 679Ch.Assert(_colToActivesIndex[col] >= 0); 685Ch.Assert(0 <= col && col < _colToActivesIndex.Length); 686Ch.Assert(_colToActivesIndex[col] >= 0); 687Ch.Assert(Schema[col].Type.RawType == typeof(TValue)); 694Ch.Assert(pipe is ShufflePipe<TValue>); 699Ch.Assert(_pipeIndex == _pipeIndices[_circularIndex]);
Transforms\SkipTakeFilter.cs (6)
91Host.Assert(skip >= 0); 92Host.Assert(take >= 0); 178Host.Assert(_skip >= 0); 180Host.Assert(_take >= 0); 241Ch.Assert(skip >= 0); 242Ch.Assert(take >= 0);
Transforms\SlotsDroppingTransformer.cs (21)
302Host.Assert(AreRangesValid(SlotsMin, SlotsMax)); 342Host.Assert(AreRangesValid(SlotsMin, SlotsMax)); 345Host.Assert(SlotsMin[i].Length == SlotsMax[i].Length); 525Host.Assert(slotsMin.Length == slotsMax.Length); 526Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 542Host.Assert(vectorType.IsKnownSize); 552Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 570Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 571Host.Assert(slotsMax != null && slotsMin != null); 572Host.Assert(slotsMax.Length == slotsMin.Length); 722Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 741Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 742Host.Assert(!(_srcTypes[iinfo] is VectorDataViewType)); 743Host.Assert(_suppressed[iinfo]); 762Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 764Host.Assert(_suppressed[iinfo]); 783Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 785Host.Assert(!_suppressed[iinfo]); 810Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 812Host.Assert(input.IsColumnActive(src)); 833Host.Assert(colIndex >= 0);
Transforms\TransformBase.cs (14)
576Host.Assert(((ICanSavePfa)this).CanSavePfa); 606Host.Assert(((ICanSaveOnnx)this).CanSaveOnnx(ctx)); 642Host.Assert(0 <= iinfo && iinfo < _bindings.InfoCount); 643Host.Assert(Infos[iinfo] == info); 645Host.Assert(((ICanSavePfa)this).CanSavePfa); 662Host.Assert(0 <= iinfo && iinfo < Infos.Length); 670Host.Assert(0 <= iinfo && iinfo < Infos.Length); 682Host.Assert(0 <= iinfo && iinfo < Infos.Length); 697Host.Assert(0 <= iinfo && iinfo < Infos.Length); 699Host.Assert(input.IsColumnActive(input.Schema[src])); 773Host.Assert(0 <= col && col < _bindings.ColumnCount); 806Host.Assert(false); 857Ch.Assert(active == null || active.Length == parent._bindings.ColumnCount); 907Ch.Assert(originFn != null);
Transforms\TypeConverting.cs (3)
222Host.Assert((InternalDataKind)(byte)_columns[i].OutputKind.ToInternalDataKind() == _columns[i].OutputKind.ToInternalDataKind()); 371ectx.Assert(KeyDataViewType.IsValidDataType(key.RawType)); 416ectx.Assert(Enum.IsDefined(typeof(InternalDataKind), kind));
Transforms\ValueMapping.cs (4)
684env.Assert(loader.Schema.TryGetColumnIndex(keyColumnName, out int keyColumnIndex)); 685env.Assert(loader.Schema.TryGetColumnIndex(valueColumnName, out int valueColumnIndex)); 749ectx.Assert(rdr.BaseStream.CanSeek); 1051Host.Assert(0 <= iinfo && iinfo < _columns.Length);
Transforms\ValueToKeyMappingTransformer.cs (14)
192Host.Assert(_codecFactory != null); 261ch.Assert(_unboundMaps.Length == columns.Length); 417ch.Assert(isBinary != isTranspose); 424ch.Assert(isTranspose); 460ch.Assert(keyData.Schema.Count == 1); 579ch.Assert((Utils.Size(toTrain) == 0) == (trainsNeeded == 0)); 580ch.Assert(Utils.Size(toTrain) <= trainsNeeded); 604ch.Assert(itrainer == trainer.Length); 636ch.Assert(termMap[iinfo] == null); 645ch.Assert(termMap.All(tm => tm != null)); 646ch.Assert(termMap.Zip(infos, (tm, info) => tm.ItemType.Equals(info.TypeSrc.GetItemType())).All(x => x)); 661Host.Assert(_unboundMaps.Length == _textMetadata.Length); 662Host.Assert(_textMetadata.Length == ColumnPairs.Length); 746Host.Assert(colIndex >= 0);
Transforms\ValueToKeyMappingTransformerImpl.cs (26)
454env.Assert(0 <= iinfo && iinfo < infos.Length); 538ectx.Assert(false); 549ectx.Assert(codec is IValueCodec<T>); 550ectx.Assert(codec.Type is PrimitiveDataViewType); 551ectx.Assert(count >= 0); 566ectx.Assert(0 <= index && index <= i); 627host.Assert(_pool.Count >= 0); 634host.Assert(nstr.Id == id); 704host.Assert(codec.Type.Equals(ItemType)); 705host.Assert(codec.Type is PrimitiveDataViewType); 827_host.Assert(0 <= iinfo && iinfo < infos.Length); 829_host.Assert(info.TypeSrc.GetItemType().Equals(map.ItemType)); 839host.Assert(0 <= iinfo && iinfo < infos.Length); 841host.Assert(info.TypeSrc.GetItemType().Equals(map.ItemType)); 912_host.Assert(input.IsColumnActive(inputColumn)); 933_host.Assert(input.IsColumnActive(inputColumn)); 1021_host.Assert(islot < values.Length); 1029_host.Assert(slot < nextExplicitSlot); 1089_host.Assert(TypedMap.ItemType is KeyDataViewType); 1110_host.Assert(srcMetaType.RawType == typeof(TMeta)); 1128_host.Assert(srcMeta.Length == srcType.GetCountAsInt32(_host)); 1139_host.Assert(0 < convKeyVal && convKeyVal <= srcMeta.Length); 1156_host.Assert(dst.Length == keyCount); 1166_host.Assert(dst.Length == keyCount); 1191_host.Assert(srcMetaType.RawType == typeof(TMeta)); 1223_host.Assert(0 < convKeyVal && convKeyVal <= srcMeta.Length);
Utilities\ModelFileUtils.cs (2)
81env.Assert(ent.Stream.Position == 0); 197env.Assert(ent.Stream.Position == 0);
Microsoft.ML.Ensemble (23)
EntryPoints\CreateEnsemble.cs (2)
110env.Assert(i == 0); 121ch.Assert(transformedDataZipEntryNames == null);
OutputCombiners\BaseMultiAverager.cs (1)
28Host.Assert(weights == null || Utils.Size(weights) == Utils.Size(src));
OutputCombiners\BaseStacking.cs (1)
78Host.Assert(Meta != null);
OutputCombiners\Median.cs (1)
84_host.Assert(weights == null || Utils.Size(weights) == Utils.Size(src));
OutputCombiners\MultiMedian.cs (1)
75Host.Assert(weights == null || Utils.Size(weights) == Utils.Size(src));
OutputCombiners\MultiVoting.cs (2)
43Host.Assert(!Normalize); 75Host.Assert(weights == null || Utils.Size(weights) == Utils.Size(src));
OutputCombiners\MultiWeightedAverage.cs (1)
87Host.Assert(Enum.IsDefined(typeof(MultiWeightageKind), _weightageKind));
OutputCombiners\Voting.cs (1)
79_host.Assert(weights == null || Utils.Size(weights) == Utils.Size(src));
PipelineEnsemble.cs (6)
164Parent.Host.Assert(0 <= i && i < Mappers.Length); 176Parent.Host.Assert(0 <= i && i < Mappers.Length); 301Host.Assert(_scoreColumnKind == AnnotationUtils.Const.ScoreColumnKind.BinaryClassification); 308Host.Assert(_scoreColumnKind == AnnotationUtils.Const.ScoreColumnKind.BinaryClassification); 620env.Assert(!(labelType is KeyDataViewType)); 648env.Assert(keyValuesType.ItemType.RawType == typeof(T));
Selector\SubModelSelector\BestDiverseSelectorMulticlass.cs (2)
45Host.Assert(models.Count > 1); 46Host.Assert(predictions.Count == models.Count);
Selector\SubModelSelector\BestPerformanceRegressionSelector.cs (1)
44Host.Assert(!string.IsNullOrEmpty(_metricName));
Selector\SubModelSelector\BestPerformanceSelector.cs (1)
44Host.Assert(!string.IsNullOrEmpty(_metricName));
Selector\SubModelSelector\BestPerformanceSelectorMulticlass.cs (1)
44Host.Assert(!string.IsNullOrEmpty(_metricName));
Trainer\EnsembleTrainerBase.cs (1)
168ch.Assert(batchModels[(int)index] == null);
Trainer\Multiclass\EnsembleMulticlassModelParameters.cs (1)
123Host.Assert(_mappers[i].OutputType.GetVectorSize() > 0);
Microsoft.ML.EntryPoints (6)
CrossValidationMacro.cs (1)
382env.Assert(Utils.Size(perInst) == 1);
JsonUtils\JsonManifestUtils.cs (4)
388ectx.Assert(false); 467ectx.Assert(componentInfo.ArgumentType == type); 479ectx.Assert(false); 496ectx.Assert(!fieldInfo.IsStatic && !fieldInfo.IsInitOnly && !fieldInfo.IsLiteral);
OneVersusAllMacro.cs (1)
146env.Assert(input.Nodes.Count > 0);
Microsoft.ML.FastTree (80)
BoostingFastTree.cs (3)
128ch.Assert(validationResult.FinalValue >= 0); 132ch.Assert(trainingResult.FinalValue >= 0); 142ch.Assert(earlyStoppingRule != null);
FastTree.cs (48)
205Host.Assert(data.Schema.Feature.HasValue); 686ch.Assert(Ensemble.Trees.Last() == tree); 943Host.Assert(Utils.Size(binUpperBounds) == NumFeatures); 944Host.Assert(binUpperBounds.All(b => b != null)); 961host.Assert(maxBins > 0); 1027ch.Assert(0 <= features.Min() && features.Max() < NumFeatures); 1028ch.Assert(features.Count > 0); 1073ch.Assert(min <= fi && fi < lim); 1075ch.Assert(subfeature >= 0); 1082ch.Assert(bub.Length > 1); 1084ch.Assert(0 < bin && bin < bub.Length); // If 0, should not have been considered "on", so what the heck? 1111ch.Assert(0 <= features.Min() && features.Max() < NumFeatures); 1112ch.Assert(features.Count > 1); 1148ch.Assert(min <= fi && fi < lim); 1150ch.Assert(subfeature >= 0); 1156ch.Assert(bub.Length == 2); 1193ch.Assert(Utils.Size(binUpperBounds) > 0); 1195ch.Assert(binnedValues.Length == values.Length); 1329Host.Assert(examples.Schema.Feature.HasValue); 1368Host.Assert(1 <= toTranspose.Count && toTranspose.Count <= 4); 1413Host.Assert(iFeature < features.Length); 1414Host.Assert(features[iFeature] == null); 1416Host.Assert(temp.Length == numExamples); 1422ch.Assert(maxBins > 0); 1444ch.Assert(slotDropper.DstLength < temp.Length); 1634Host.Assert(features.All(f => f != null)); 1846ch.Assert(pos >= 0); 1849Host.Assert(hasGroup || cursor.Group == groupPrev); 1947ch.Assert(Utils.Size(features) > 1); 1995ch.Assert(kvp.Key >= last); 1996ch.Assert(kvp.Value > 0); 2003ch.Assert(kvp.Key - last <= Byte.MaxValue); 2008ch.Assert(kvp.Key > last || values.Count == 1 || values[values.Count - 1] > values[values.Count - 2]); 2055ch.Assert(iFeature <= NumFeatures); // Some could have been filtered. 2056ch.Assert(iFeature == FeatureMap.Length); 2079ch.Assert(Utils.Size(bup) > 0); 2213ch.Assert(pending.Count > 0); 2247ch.Assert(0 < countBins && countBins <= Utils.ArrayMaxSize); 2248ch.Assert(limMade < iFeature); 2249ch.Assert(pending.Count > 0); 2298ch.Assert(limMade < iFeature); 2299ch.Assert(canBeOneHot); 2322ch.Assert(values.CountIndicesGT(NumExamples, firstBin) == localHotRows); 2328ch.Assert(limMade < iFeature); 2329ch.Assert(countHotRows < hotNThreshold); 2330ch.Assert(!canBeOneHot); 2907Host.Assert(NumFeatures >= 0); 3141Host.Assert(pair.Value is double);
FastTreeRanking.cs (1)
223Host.Assert(FastTreeTrainerOptions.BaggingSize > 0);
GamModelParameters.cs (7)
171Host.Assert(NumberOfShapeFunctions >= 0); 173Host.Assert(_numInputFeatures >= 0); 183Host.Assert(_binUpperBounds[i].Length == _binEffects[i].Length); 491Host.Assert(internalNodeId == 0); 506Host.Assert(lower == upper + 1); 675ch.Assert(_scores.Length == _labels.Length); 754ch.Assert(_saveVersion <= _version);
GamTrainer.cs (2)
264Host.Assert(FeatureMap == null || FeatureMap.Length == TrainSet.NumFeatures); 270Host.Assert(data.Schema.Feature.HasValue);
SumupPerformanceCommand.cs (5)
130ch.Assert(FloatUtils.IsFinite(denom) && denom < 0); 147ch.Assert(remaining == 0); 214_host.Assert(0 < sparsity && sparsity < 1); 232_host.Assert(0 <= sparsity && sparsity <= 1); 245_host.Assert(Utils.IsIncreasing(0, data.DocIndices, count, _len));
TreeEnsemble\TreeEnsembleCombiner.cs (1)
114_host.Assert(false);
TreeEnsembleFeaturizer.cs (13)
110ectx.Assert(schema.Feature.HasValue); 249_ectx.Assert(ensemble.TrainedEnsemble.NumTrees > 0); 282_ectx.Assert(_input.Position >= 0); 283_ectx.Assert(_cachedPosition == _input.Position); 308_ectx.Assert(_input.Position >= 0); 309_ectx.Assert(_cachedPosition == _input.Position); 327_ectx.Assert(0 <= node && node < numNodes); 346_ectx.Assert(Utils.Size(_leafIds) == _numTrees); 347_ectx.Assert(Utils.Size(_pathIds) == _numTrees); 498_host.Assert(i == _totalLeafCount); 518_host.Assert(i == totalNodeCount); 716ch.Assert(data.Schema.Feature.HasValue); 717ch.Assert(predictor == predictor2);
Microsoft.ML.ImageAnalytics (1)
VectorToImageTransform.cs (1)
328Host.Assert(0 <= iinfo && iinfo < _parent._columns.Length);
Microsoft.ML.KMeansClustering (14)
KMeansModelParameters.cs (2)
167Host.Assert(distances.Length >= _k); 185Host.Assert(_dimensionality == _centroids[i].Length);
KMeansPlusPlusTrainer.cs (12)
404ch.Assert(FloatUtils.IsFinite(probabilityWeight)); 862ch.Assert(clusterCount - clusterPrevCount <= numSamplesPerRound); 903ch.Assert(clusterCount - clusterPrevCount <= numSamplesPerRound); 907ch.Assert(clusterCount == clusters.Length); 926ch.Assert(bestCluster == debugBestCluster); 956ch.Assert(totalWeights[i] == debugTotalWeights[i]); 958ch.Assert(totalWeights.Length == clusters.Length); 1275ch.Assert(k > 0); 1276ch.Assert(totalTrainingInstances > 0); 1602host.Assert(numSamples > 0); 1603host.Assert(numThreads > 0); 1653host.Assert(finalHeap == null);
Microsoft.ML.LightGbm (15)
LightGbmMulticlassTrainer.cs (2)
337ch.Assert(PredictionKind == PredictionKind.MulticlassClassification); 338ch.Assert(_numberOfClassesIncludingNan > 1);
LightGbmTrainerBase.cs (12)
1030ch.Assert(dataset.GetNumRows() == numRow); 1031ch.Assert(dataset.GetNumCols() == catMetaData.NumCol); 1057ch.Assert(totalRowCount < numRow); 1063ch.Assert(numElem == curRowCount * catMetaData.NumCol); 1071ch.Assert(totalRowCount == numRow); 1074ch.Assert(numElem == curRowCount * catMetaData.NumCol); 1093ch.Assert(totalRowCount < numRow); 1099ch.Assert(curRowCount > 0); 1117ch.Assert(totalRowCount == numRow); 1135ch.Assert(features.Length >= numElem + catMetaData.NumCol); 1177ch.Assert(indices.Length >= numElem + numValue); 1178ch.Assert(features.Length >= numElem + numValue);
WrappedLightGbmTraining.cs (1)
47ch.Assert(parameters.ContainsKey("metric"));
Microsoft.ML.Maml (5)
HelpCommand.cs (5)
155_env.Assert(signature.BaseType == typeof(MulticastDelegate)); 205_env.Assert(signature.BaseType == typeof(MulticastDelegate)); 228_env.Assert(loadName == loadNames[0]); 287_env.Assert(info.LoadNames.Count > 0); 373_env.Assert(screenWidth > 0);
Microsoft.ML.Mkl.Components (25)
OlsLinearRegression.cs (6)
238ch.Assert(values.Length + 1 == m); 322ch.Assert(values.Length + 1 == m); 326ch.Assert(ioff == i * (i + 1) / 2); 336ch.Assert(ioff == xtx.Length); 379ch.Assert(ioff == xtx.Length - 1); 490ch.Assert(!Double.IsNaN(rSquaredAdjusted));
SymSgdClassificationTrainer.cs (6)
203ch.Assert(idvToFeedTrain.CanShuffle); 208ch.Assert(examplesToFeedTrain.Schema.Label.HasValue); 209ch.Assert(examplesToFeedTrain.Schema.Feature.HasValue); 211ch.Assert(examplesToFeedTrain.Schema.Weight.HasValue); 415_ch.Assert(_storage[_storageIndex].Length == _veryLongArrayLength); 427_ch.Assert(instArrayLength * _sizeofT * 2 < _trainer.AcceleratedMemoryBudgetBytes);
VectorWhitening.cs (13)
311ch.Assert(vectorType != null && vectorType.IsKnownSize); 357ch.Assert(idxDst[i] == columnData[i].Length); 369ch.Assert(columnData.Length == rowCounts.Length); 405ch.Assert(r == 0); 460ch.Assert(false); 480Host.Assert(_columns.Length == ColumnPairs.Length); 589Host.Assert(colIndex >= 0); 600Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 604Host.Assert(ex.Kind == WhiteningKind.PrincipalComponentAnalysis || ex.Kind == WhiteningKind.ZeroPhaseComponentAnalysis); 649Host.Assert(model.Length == dimension * dimension); 652Host.Assert(parameters.Kind == WhiteningKind.PrincipalComponentAnalysis || parameters.Kind == WhiteningKind.ZeroPhaseComponentAnalysis); 674Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 676Host.Assert(input.IsColumnActive(srcCol));
Microsoft.ML.OneDal (1)
OneDalUtils.cs (1)
58channel.Assert(values.Length == numberOfFeatures);
Microsoft.ML.OnnxConverter (5)
OnnxContextImpl.cs (2)
149_host.Assert(!_nodeNames.Contains(node.Name)); 192_host.Assert(_columnNameMap.ContainsKey(colName));
SaveOnnxCommand.cs (3)
184ch.Assert(trans.CanSaveOnnx(ctx)); 335Host.Assert(transforms.Count == 0 || transforms.Last.Value == end); 355Host.Assert(scorePipe.Source == end);
Microsoft.ML.PCA (3)
PcaTrainer.cs (2)
302host.Assert(Utils.Size(y) == omega.Length); // Size of Y and Omega: dimension x oversampled rank 633Host.Assert(src.Length == _dimension);
PcaTransformer.cs (1)
393Host.Assert(mean.Length == omega.Length && omega.Length == y.Length && y.Length == _numColumns);
Microsoft.ML.Recommender (14)
MatrixFactorizationPredictor.cs (9)
96_host.Assert(matrixColumnIndexType.RawType == typeof(uint)); 97_host.Assert(matrixRowIndexType.RawType == typeof(uint)); 104_host.Assert(NumberOfColumns == matrixColumnIndexType.GetCountAsInt32(_host)); 105_host.Assert(NumberOfRows == matrixRowIndexType.GetCountAsInt32(_host)); 106_host.Assert(_leftFactorMatrix.Length == NumberOfRows * ApproximationRank); 107_host.Assert(_rightFactorMatrix.Length == ApproximationRank * NumberOfColumns); 297_host.Assert(0 <= rowIndex && rowIndex < NumberOfRows); 298_host.Assert(0 <= columnIndex && columnIndex < NumberOfColumns); 395_env.Assert(Utils.Size(active) == OutputSchema.Count);
MatrixFactorizationTrainer.cs (2)
470ch.Assert(rowCount > 0); 471ch.Assert(colCount > 0);
SafeTrainingAndModelBuffer.cs (3)
254_host.Assert(_pMFModel == null); 321_host.Assert(_pMFModel == null); 353_host.Assert(_pMFModel == null);
Microsoft.ML.StandardTrainers (160)
FactorizationMachine\FactorizationMachineTrainer.cs (5)
422_host.Assert(!col.IsHidden); 427_host.Assert(vectorType.Size > 0); 441_host.Assert(fieldCount == validFeatureColumns.Count); 446_host.Assert(featCol.Name == validFeatCol.Name); 447_host.Assert(featCol.Type == validFeatCol.Type);
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (15)
79Host.Assert(fieldCount > 0); 80Host.Assert(featureCount > 0); 81Host.Assert(latentDim > 0); 82Host.Assert(Utils.Size(linearWeights) == featureCount); 84Host.Assert(Utils.Size(latentWeights) == checked(featureCount * fieldCount * LatentDimAligned)); 114Host.Assert(fieldCount > 0); 115Host.Assert(featureCount > 0); 116Host.Assert(latentDim > 0); 117Host.Assert(Utils.Size(linearWeights) == featureCount); 119Host.Assert(latentWeightsAligned.Size == checked(featureCount * fieldCount * LatentDimAligned)); 202Host.Assert(FieldCount > 0); 203Host.Assert(FeatureCount > 0); 204Host.Assert(LatentDimension > 0); 205Host.Assert(Utils.Size(_linearWeights) == FeatureCount); 206Host.Assert(_latentWeightsAligned.Size == FeatureCount * FieldCount * LatentDimAligned);
LdSvm\LdSvmModelParameters.cs (41)
58Host.Assert(treeDepth > 0 && treeDepth < 31); 61Host.Assert(w.Length == numLeaf * 2 - 1); 62Host.Assert(w.All(v => v.IsDense)); 63Host.Assert(w.All(v => v.Length == w[0].Length)); 64Host.Assert(thetaPrime.Length == numLeaf * 2 - 1); 65Host.Assert(thetaPrime.All(v => v.IsDense)); 66Host.Assert(thetaPrime.All(v => v.Length == thetaPrime[0].Length)); 67Host.Assert(theta.Length == numLeaf - 1); 68Host.Assert(theta.All(v => v.IsDense)); 69Host.Assert(theta.All(v => v.Length == theta[0].Length)); 70Host.Assert(biasW.Length == numLeaf * 2 - 1); 71Host.Assert(biasTheta.Length == numLeaf - 1); 72Host.Assert(biasThetaPrime.Length == numLeaf * 2 - 1); 73Host.Assert((w[0].Length > 0) && (w[0].Length == thetaPrime[0].Length) && (w[0].Length == theta[0].Length)); 128Host.Assert(_numLeaf > 1 && (_numLeaf & (_numLeaf - 1)) == 0); // Check if _numLeaf is power of 2 129Host.Assert(_w.Length == _numLeaf * 2 - 1); 130Host.Assert(_w.All(v => v.IsDense)); 131Host.Assert(_w.All(v => v.Length == _w[0].Length)); 132Host.Assert(_thetaPrime.Length == _numLeaf * 2 - 1); 133Host.Assert(_thetaPrime.All(v => v.IsDense)); 134Host.Assert(_thetaPrime.All(v => v.Length == _thetaPrime[0].Length)); 135Host.Assert(_theta.Length == _numLeaf - 1); 136Host.Assert(_theta.All(v => v.IsDense)); 137Host.Assert(_theta.All(v => v.Length == _theta[0].Length)); 138Host.Assert(_biasW.Length == _numLeaf * 2 - 1); 139Host.Assert(_biasTheta.Length == _numLeaf - 1); 140Host.Assert(_biasThetaPrime.Length == _numLeaf * 2 - 1); 141Host.Assert((_w[0].Length > 0) && (_w[0].Length == _thetaPrime[0].Length) && (_w[0].Length == _theta[0].Length)); // numFeatures 142Host.Assert(InputType != null && InputType.GetVectorSize() == _w[0].Length); 186Host.Assert(_w.Length == _numLeaf * 2 - 1); 188Host.Assert(_thetaPrime.Length == _numLeaf * 2 - 1); 190Host.Assert(_theta.Length == _numLeaf - 1); 193Host.Assert(_biasW.Length == _numLeaf * 2 - 1); 195Host.Assert(_biasTheta.Length == _numLeaf - 1); 197Host.Assert(_biasThetaPrime.Length == _numLeaf * 2 - 1); 215Host.Assert(vector.IsDense); 216Host.Assert(vector.Length == vectorLength); 230Host.Assert(length >= 0); 231Host.Assert(vectorLength >= 0); 238Host.Assert(result[i].IsDense); 239Host.Assert(result[i].Length == vectorLength);
LdSvm\LdSvmTrainer.cs (12)
408Host.Assert(Utils.Size(tempW) == count); 409Host.Assert(Utils.Size(w) == count); 410Host.Assert(Utils.Size(theta) == half); 411Host.Assert(Utils.Size(thetaPrime) == count); 412Host.Assert(Utils.Size(biasW) == count); 413Host.Assert(Utils.Size(biasTheta) == half); 414Host.Assert(Utils.Size(biasThetaPrime) == count); 415Host.Assert(Utils.Size(tempThetaPrime) == count); 416Host.Assert(Utils.Size(tempTheta) == half); 417Host.Assert(Utils.Size(tempBiasW) == count); 418Host.Assert(Utils.Size(tempBiasTheta) == half); 419Host.Assert(Utils.Size(tempBiasThetaPrime) == count);
Optimizer\L1Optimizer.cs (2)
80ch.Assert(0 <= biasCount && biasCount < initial.Length); 81ch.Assert(l1Weight > 0);
Standard\LinearModelParameters.cs (1)
172Host.Assert(len > 0);
Standard\LogisticRegression\LbfgsPredictorBase.cs (11)
470ch.Assert(numThreads > 0); 509ch.Assert(values.Length == nFeatures); 572ch.Assert(numThreads > 0); 620ch.Assert(cursor.KeptRowCount <= int.MaxValue); 648ch.Assert(numThreads > 1); 659ch.Assert(numThreads > 0); 668ch.Assert(0 < cchkLeft && cchkLeft <= numThreads); 670ch.Assert(0 < cinstThis && cinstThis <= cinstTot - iinstMin); 681ch.Assert(_numChunks > 0 && _data == null); 688ch.Assert(_numChunks == 0 && _data != null); 709ch.Assert(CurrentWeights.Length == BiasCount + WeightCount);
Standard\LogisticRegression\LogisticRegression.cs (3)
274Host.Assert(namesSpans.Length == featureLength); 364ch.Assert(ioff == i * (i + 1) / 2); 378ch.Assert(ioff == hessian.Length);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (11)
629Host.Assert(Biases.Length == NumberOfClasses); 630Host.Assert(Biases.Length == Weights.Length); 633Host.Assert(fw.Length == NumberOfFeatures); 664Host.Assert(fv.Length == NumberOfFeatures); 714Host.Assert(count == numIndices); 741Host.Assert(count == numIndices); 878Host.Assert(namedValues.Value is float); 985Host.Assert(outputs[0] == DefaultColumnNames.PredictedLabel); 986Host.Assert(outputs[1] == DefaultColumnNames.Score); 1052Host.Assert(featuresCount == Weights[i].Length); 1241Host.Assert(dst.Length == NumberOfClasses);
Standard\ModelStatistics.cs (15)
97Env.Assert(trainingExampleCount > 0); 98Env.Assert(paramCount > 0); 144Env.Assert(ParametersCount > 0); 147Env.Assert(TrainingExampleCount > 0); 248Env.Assert(trainingExampleCount > 0); 249Env.Assert(paramCount > 0); 285env.Assert(length > ParametersCount); 320Env.Assert(coeffStdErrorValues.Length == ParametersCount); 408Env.Assert(_coeffStdError.Length == _weights.Length + 1); 420Env.Assert(0 <= wi && wi < _weights.Length); 445Env.Assert(0 <= wi && wi < _weights.Length); 484Env.Assert(featureNames.Length >= 1); 493Env.Assert(0 <= probZ && probZ <= 1); 514Env.Assert(coeffStat.Index < featureNames.Length); 549Env.Assert(coeffStat.Index < featureNames.Length);
Standard\MulticlassClassification\MetaMulticlassTrainer.cs (3)
94Host.Assert(type.RawType == typeof(T)); 97Host.Assert(data.Schema.Label.HasValue); 126Host.Assert(count > 0);
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (3)
296Host.Assert(labelHistogram.Length == featureHistogram.Length); 297Host.Assert(featureHistogram.All(h => h == null || h.Length == featureCount)); 591Host.Assert(featureCount >= 0);
Standard\MulticlassClassification\OneVersusAllTrainer.cs (3)
194Host.Assert(!label.IsHidden); 195Host.Assert(label.Type.GetKeyCount() > 0 || label.Type == NumberDataViewType.Single || label.Type == NumberDataViewType.Double); 360Host.Assert(Utils.Size(impl.Predictors) > 0);
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (14)
167Host.Assert(!label.IsHidden); 168Host.Assert(label.Type.GetKeyCount() > 0 || label.Type == NumberDataViewType.Single || label.Type == NumberDataViewType.Double); 265Host.Assert(Utils.Size(predictors) > 0); 273Host.Assert(Utils.Size(predictors[i]) == i + 1); 276Host.Assert(index == GetIndex(i, j)); 280Host.Assert(index == _predictors.Length); 304Host.Assert(index == GetIndex(i, j)); 307Host.Assert(index == GetIndex(i, i)); 381Host.Assert(0 <= value && value <= 1); 414Host.Assert(index == GetIndex(j, i)); 435Host.Assert(values[index + j] >= pii); 442Host.Assert(index == GetIndex(j, i)); 443Host.Assert(values[index] >= pii); 454Host.Assert(0 <= j && j <= i && i < _numClasses);
Standard\Online\OnlineLinear.cs (4)
129ch.Assert(Iteration == 0); 130ch.Assert(Bias == 0); 229ch.Assert(FloatUtils.IsFinite(feat.GetValues())); 297ch.Assert(state.WeightsScale == 1);
Standard\SdcaBinary.cs (12)
114ch.Assert(idvToFeedTrain.CanShuffle); 119ch.Assert(examplesToFeedTrain.Schema.Label.HasValue); 120ch.Assert(examplesToFeedTrain.Schema.Feature.HasValue); 122ch.Assert(examplesToFeedTrain.Schema.Weight.HasValue); 344ch.Assert(numThreads > 0); 362ch.Assert(checkFrequency > 0); 464ch.Assert(SdcaTrainerOptions.L1Regularization.HasValue); 494ch.Assert(SdcaTrainerOptions.L2Regularization.HasValue); 557ch.Assert(metricNames.Length == metrics.Length); 558ch.Assert(SdcaTrainerOptions.MaximumNumberOfIterations.HasValue); 989Host.Assert(idToIdx == null || row == duals.Length); 2043ch.Assert(numThreads > 0);
Standard\SdcaMulticlass.cs (1)
408Host.Assert(idToIdx == null || row * numClasses == duals.Length);
Standard\StochasticTrainerBase.cs (4)
78ch.Assert(idvToFeedTrain.CanShuffle); 83ch.Assert(examplesToFeedTrain.Schema.Label.HasValue); 84ch.Assert(examplesToFeedTrain.Schema.Feature.HasValue); 86ch.Assert(examplesToFeedTrain.Schema.Weight.HasValue);
Microsoft.ML.Sweeper (14)
Algorithms\KdoSweeper.cs (6)
159_host.Assert(Utils.Size(previousRuns) > 1); 179_host.Assert(history.Length == weights.Length && parentIndicies.Max() < history.Length); 447_host.Assert(weights.Sum() > 0); 455_host.Assert(d > 0 && diagonalCovariance.Length == d); 458_host.Assert(diagonalCovariance[i].Length == d); 461_host.Assert((i == j && diagonalCovariance[i][j] >= 0) || diagonalCovariance[i][j] == 0);
Algorithms\SmacSweeper.cs (5)
211_host.Assert(randomConfigs.Length == randomEIs.Length); 299_host.Assert(hotIndex >= 0); 439_host.Assert(parameterSet.Count == _sweepParameters.Length); 440_host.Assert(index >= 0 && index <= _sweepParameters.Length); 458_host.Assert(hotIndex >= 0);
Algorithms\SweeperProbabilityUtils.cs (3)
162host.Assert(ps.Count == sweepParams.Length); 187host.Assert(hotIndex >= 0); 234host.Assert(hotIndex >= i);
Microsoft.ML.TensorFlow (3)
TensorflowTransform.cs (3)
175env.Assert(actualRead == fileLength); 489Host.Assert(actualWritten == fileLength); 648Host.Assert(type == _parent.OutputTypes[iinfo].GetItemType().RawType);
Microsoft.ML.TimeSeries (125)
AdaptiveSingularSpectrumSequenceModeler.cs (16)
298_host.Assert(model._windowSize >= 2); 299_host.Assert(model._seriesLength > model._windowSize); 300_host.Assert(model._trainSize > 2 * model._windowSize); 301_host.Assert(0 <= model._discountFactor && model._discountFactor <= 1); 302_host.Assert(1 <= model._rank && model._rank < model._windowSize); 454_host.Assert(_windowSize >= 2); 455_host.Assert(_seriesLength > _windowSize); 456_host.Assert(_trainSize > 2 * _windowSize); 457_host.Assert(0 <= _discountFactor && _discountFactor <= 1); 458_host.Assert(1 <= _rank && _rank < _windowSize); 459_host.Assert(Utils.Size(_alpha) == _windowSize - 1); 460_host.Assert(_observationNoiseVariance >= 0); 461_host.Assert(_autoregressionNoiseVariance >= 0); 462_host.Assert(1 <= _maxRank && _maxRank <= _windowSize - 1); 463_host.Assert(_maxTrendRatio >= 0); 1253_host.Assert(Utils.Size(dataArray) > 0);
ExponentialAverageTransform.cs (2)
83Host.Assert(WindowSize >= 1); 84Host.Assert(0 <= _decay && _decay <= 1);
IidAnomalyDetectionBase.cs (1)
141Host.Assert(InitialWindowSize == 0);
IidChangePointDetector.cs (2)
179InternalTransform.Host.Assert(InternalTransform.ThresholdScore == AlertingScore.MartingaleScore); 180InternalTransform.Host.Assert(InternalTransform.Side == AnomalySide.TwoSided);
IidSpikeDetector.cs (1)
160InternalTransform.Host.Assert(InternalTransform.ThresholdScore == AlertingScore.PValueScore);
MovingAverageTransform.cs (3)
99Host.Assert(WindowSize >= 1); 100Host.Assert(_lag >= 0); 111Host.Assert(_weights == null || Utils.Size(_weights) == WindowSize + 1 - _lag);
PercentileThresholdTransform.cs (2)
90Host.Assert(MinPercentile <= _percentile && _percentile <= MaxPercentile); 91Host.Assert(WindowSize >= 1);
PValueTransform.cs (1)
95Host.Assert(WindowSize >= 1);
SequentialAnomalyDetectionTransformBase.cs (17)
240Host.Assert(Enum.IsDefined(typeof(MartingaleType), Martingale)); 241Host.Assert(Enum.IsDefined(typeof(AlertingScore), ThresholdScore)); 242Host.Assert(Martingale != MartingaleType.None || ThresholdScore != AlertingScore.MartingaleScore); 243Host.Assert(WindowSize > 0 || ThresholdScore == AlertingScore.RawScore); 244Host.Assert(Enum.IsDefined(typeof(AnomalySide), Side)); 245Host.Assert(0 < PowerMartingaleEpsilon && PowerMartingaleEpsilon < 1); 246Host.Assert(AlertThreshold >= 0); 247Host.Assert(ThresholdScore != AlertingScore.PValueScore || (0 <= AlertThreshold && AlertThreshold <= 1)); 274Host.Assert(MinPValue > 0); 275Host.Assert(MaxPValue < 1); 276Host.Assert(MinPValue <= p && p <= MaxPValue); 277Host.Assert(0 < epsilon && epsilon < 1); 290Host.Assert(MinPValue > 0); 291Host.Assert(MaxPValue < 1); 292Host.Assert(MinPValue <= p && p <= MaxPValue); 525Host.Assert(outputLength >= 2); 658Host.Assert(WindowSize >= 0);
SequentialForecastingTransformBase.cs (1)
309Host.Assert(WindowSize >= 0);
SequentialTransformBase.cs (6)
139Host.Assert(_isIniatilized); 140Host.Assert(WindowedBuffer != null); 141Host.Assert(InitialWindowedBuffer != null); 329Host.Assert(InitialWindowSize >= 0); 330Host.Assert(WindowSize >= 0); 403Ch.Assert(input.Schema.Count == parent.OutputSchema.Count);
SequentialTransformerBase.cs (5)
133Host.Assert(WindowedBuffer != null); 134Host.Assert(InitialWindowedBuffer != null); 420Host.Assert(InitialWindowSize >= 0); 421Host.Assert(WindowSize >= 0); 698Ch.Assert(input.Schema.Count == parent.OutputSchema.Count);
SlidingWindowTransformBase.cs (4)
70Host.Assert(args.WindowSize == 1); 112Host.Assert(WindowSize >= 1); 113Host.Assert(_lag >= 0); 114Host.Assert(Enum.IsDefined(typeof(BeginOptions), _begin));
SrCnnTransformBase.cs (7)
125Host.Assert(WindowSize > 0); 126Host.Assert(InitialWindowSize == WindowSize); 127Host.Assert(BackAddWindowSize > 0); 128Host.Assert(LookaheadWindowSize > 0); 129Host.Assert(AvergingWindowSize > 0); 130Host.Assert(JudgementWindowSize > 0); 131Host.Assert(AlertThreshold >= 0 && AlertThreshold <= 1);
SsaAnomalyDetectionBase.cs (5)
269Host.Assert(InitialWindowSize == 0); 270Host.Assert(2 <= SeasonalWindowSize); 271Host.Assert(0 <= DiscountFactor && DiscountFactor <= 1); 272Host.Assert(Enum.IsDefined(typeof(ErrorFunction), ErrorFunction)); 273Host.Assert(Model != null);
SsaChangePointDetector.cs (5)
143InternalTransform.Host.Assert(!Enum.IsDefined(typeof(MartingaleType), InternalTransform.Martingale)); 186InternalTransform.Host.Assert(InternalTransform.ThresholdScore == AlertingScore.MartingaleScore); 187InternalTransform.Host.Assert(InternalTransform.Side == AnomalySide.TwoSided); 188InternalTransform.Host.Assert(InternalTransform.DiscountFactor == 1); 189InternalTransform.Host.Assert(InternalTransform.IsAdaptive == false);
SSaForecasting.cs (1)
193InternalTransform.Host.Assert(InternalTransform.IsAdaptive == false);
SsaForecastingBase.cs (2)
193Host.Assert(InitialWindowSize == 0); 194Host.Assert(Model != null);
SsaSpikeDetector.cs (3)
168InternalTransform.Host.Assert(InternalTransform.ThresholdScore == AlertingScore.PValueScore); 169InternalTransform.Host.Assert(InternalTransform.DiscountFactor == 1); 170InternalTransform.Host.Assert(InternalTransform.IsAdaptive == false);
TrajectoryMatrix.cs (41)
192_ectx.Assert(Utils.Size(cov) >= _windowSize * _windowSize); 264_ectx.Assert(srcIndex >= 0); 265_ectx.Assert(dstIndex >= 0); 266_ectx.Assert(Utils.Size(vector) >= _k + srcIndex); 267_ectx.Assert(Utils.Size(result) >= _windowSize + dstIndex); 294_ectx.Assert(srcIndex >= 0); 295_ectx.Assert(dstIndex >= 0); 296_ectx.Assert(Utils.Size(vector) >= _k + srcIndex); 297_ectx.Assert(Utils.Size(result) >= _windowSize + dstIndex); 368_ectx.Assert(srcIndex >= 0); 369_ectx.Assert(dstIndex >= 0); 370_ectx.Assert(Utils.Size(vector) >= _windowSize + srcIndex); 371_ectx.Assert(Utils.Size(result) >= _k + dstIndex); 398_ectx.Assert(srcIndex >= 0); 399_ectx.Assert(dstIndex >= 0); 400_ectx.Assert(Utils.Size(vector) >= _windowSize + srcIndex); 401_ectx.Assert(Utils.Size(result) >= _k + dstIndex); 489_ectx.Assert(0 <= ue && ue < _windowSize); 490_ectx.Assert(0 <= us && us <= ue); 491_ectx.Assert(0 <= ve && ve < _k); 492_ectx.Assert(0 <= vs && vs <= ve); 498_ectx.Assert(uIndex >= 0); 499_ectx.Assert(vIndex >= 0); 500_ectx.Assert(dstIndex >= 0); 501_ectx.Assert(Utils.Size(u) >= _windowSize + uIndex); 502_ectx.Assert(Utils.Size(v) >= _k + vIndex); 503_ectx.Assert(Utils.Size(result) >= len + dstIndex); 504_ectx.Assert(!Single.IsNaN(sigma)); 505_ectx.Assert(!Single.IsInfinity(sigma)); 562_ectx.Assert(0 <= ue && ue < _windowSize); 563_ectx.Assert(0 <= us && us <= ue); 564_ectx.Assert(0 <= ve && ve < _k); 565_ectx.Assert(0 <= vs && vs <= ve); 569_ectx.Assert(uIndex >= 0); 570_ectx.Assert(vIndex >= 0); 571_ectx.Assert(dstIndex >= 0); 572_ectx.Assert(Utils.Size(u) >= _windowSize + uIndex); 573_ectx.Assert(Utils.Size(v) >= _k + vIndex); 574_ectx.Assert(Utils.Size(result) >= len + dstIndex); 575_ectx.Assert(!Single.IsNaN(sigma)); 576_ectx.Assert(!Single.IsInfinity(sigma));
Microsoft.ML.Transforms (299)
Dracula\CountTableTransformer.cs (12)
151_host.Assert(_initialCounts != null || _sharedBuilder != null || _builders != null); 164_host.Assert(col.HasValue); 226_host.Assert(type is KeyDataViewType || type is NumberDataViewType || type is BooleanDataViewType); 244_host.Assert(type.GetKeyCount() > 0); 298_host.Assert(data.Schema.Label.HasValue); 447Host.Assert(Utils.Size(seeds) == featurizer.ColCount); 579Host.Assert(!string.IsNullOrEmpty(_labelClassNames[i])); 635Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 640Host.Assert(inputCol.HasSlotNames()); 646Host.Assert(inputSlotNames.Length == inputCol.Type.GetValueCount()); 682Host.Assert(_parent.Featurizer.SlotCount[iinfo] == 1); 701Host.Assert(_parent.Featurizer.SlotCount[iinfo] == n);
Dracula\Featurizer.cs (6)
140_host.Assert(features.Length == NumFeatures); 163_host.Assert(FloatUtils.IsFinite(features)); 173_host.Assert(_labelBinCount == counts.Length); 194_host.Assert(counts.Length == _labelBinCount); 195_host.Assert(logOdds.Length == _logOddsCount); 199_host.Assert(counts[i] >= 0);
Dracula\MultiCountTable.cs (5)
101_host.Assert(size > 0); 112_host.Assert(0 <= iCol && iCol < _countTableBuilders.Length); 113_host.Assert(0 <= iSlot && iSlot < _countTableBuilders[iCol].Length); 181Host.Assert(_countTables.Length > 0); 187Host.Assert(size > 0);
Expression\LambdaBinder.cs (54)
61env.Assert(binder._rgwith.Count == 0); 111_host.Assert(node.IsBool); 118_host.Assert(node.IsTX); 125_host.Assert(node.IsNumber || node.IsError); 126_host.Assert((node.ExprValue == null) == node.IsError); 143_host.Assert(HasErrors); 180_host.Assert(node.ExprType != 0); 192_host.Assert(_lambda == node); 200_host.Assert(false); 226_host.Assert(HasErrors); 232_host.Assert(HasErrors); 240_host.Assert(HasErrors); 253_host.Assert(HasErrors); 292_host.Assert(false); 342_host.Assert(HasErrors); 347_host.Assert(false); 357_host.Assert(node.Op == BinaryOp.And || node.Op == BinaryOp.Or || node.Op == BinaryOp.Coalesce); 393_host.Assert(node.IsBool); 418_host.Assert(MapKindToIndex(kind) >= 0); 741_host.Assert(false); 763_host.Assert(false); 787_host.Assert(false); 811_host.Assert(false); 994_host.Assert(HasErrors); 1013_host.Assert(false); 1039_host.Assert(false); 1043_host.Assert((cmpLax == null) == (cmpStrict == null)); 1068_host.Assert(arg.ExprType == kind); 1070_host.Assert(valuePrev != null); 1074_host.Assert(tid == tidLax || tid == tidStrict); 1080_host.Assert(arg.ExprType == kind); 1083_host.Assert(value != null); 1101_host.Assert(arg.ExprType == kind); 1104_host.Assert(value != null); 1108_host.Assert(arg2.ExprType == kind); 1111_host.Assert(value2 != null); 1391_host.Assert(candidates.Count > 0); 1392_host.Assert(count == 0 || count == candidates.Count); 1403_host.Assert(0 <= icandMinBad && icandMinBad < candidates.Count); 1422_host.Assert(!best.IsVariable); 1423_host.Assert(best.Arity == 1); 1443_host.Assert(tail >= 0); 1445_host.Assert(type.IsArray); 1455_host.Assert(res != null); 1456_host.Assert(res.GetType() == best.Method.ReturnType); 1552_host.Assert(Utils.Size(candidates) >= 2); 1587_host.Assert((dup1 != null) == (dup2 != null)); 1621_host.Assert(_rgwith.Count == iwith + 1); 1622_host.Assert(_rgwith[iwith] == node); 1624_host.Assert(_rgwith.Count == iwith); 1633_host.Assert(false); 1647_host.Assert(expr.ExprType != 0); 1653_host.Assert(HasErrors); 1666_host.Assert(HasErrors);
ExpressionTransformer.cs (32)
187_host.Assert(typeRes is PrimitiveDataViewType); 201_host.Assert(b); 261ectx.Assert(Utils.Size(inputTypes) == Utils.Size(inputColumnNames)); 412Host.Assert(_columns[i].VectorInputColumn >= -1); 461ectx.Assert(inputColumns.Length == 1); 476ectx.Assert(inputColumns.Length == 2); 494ectx.Assert(inputColumns.Length == 3); 515ectx.Assert(inputColumns.Length == 4); 539ectx.Assert(inputColumns.Length == 5); 566ectx.Assert(_columns[iinfo].VectorInputColumn >= 0); 603ectx.Assert(inputColumns.Length == 1); 604ectx.Assert(perm.Length == 1); 605ectx.Assert(perm[0] == 0); 650ectx.Assert(0 <= ii && ii <= count); 651ectx.Assert(ii == count || src0.GetIndices()[ii] >= i); 668ectx.Assert(inputColumns.Length == 2); 669ectx.Assert(perm.Length == 2); 710ectx.Assert(0 <= ii && ii <= count); 711ectx.Assert(ii == count || src0.GetIndices()[ii] >= i); 728ectx.Assert(inputColumns.Length == 3); 729ectx.Assert(perm.Length == 3); 773ectx.Assert(0 <= ii && ii <= count); 774ectx.Assert(ii == count || src0.GetIndices()[ii] >= i); 791ectx.Assert(inputColumns.Length == 4); 792ectx.Assert(perm.Length == 4); 839ectx.Assert(0 <= ii && ii <= count); 840ectx.Assert(ii == count || src0.GetIndices()[ii] >= i); 857ectx.Assert(inputColumns.Length == 5); 858ectx.Assert(perm.Length == 5); 908ectx.Assert(0 <= ii && ii <= count); 909ectx.Assert(ii == count || src0.GetIndices()[ii] >= i); 968_parent.Host.Assert(0 <= iinfo && iinfo < _parent._columns.Length);
GcnTransform.cs (6)
310Host.Assert(_columns.Length == ColumnPairs.Length); 367Host.Assert(0 < ex.Scale && ex.Scale < float.PositiveInfinity); 368Host.Assert(_srcTypes[iinfo] is VectorDataViewType); 478ectx.Assert(divisor >= 0); 485ectx.Assert(count > 0); 486ectx.Assert(length > 0);
GroupTransform.cs (3)
581Ch.Assert(_leadingCursor.Position >= 0); 595Ch.Assert(groupSize > 0); 605Ch.Assert(res);
HashJoiningTransform.cs (12)
202Host.Assert(Infos.Length == Utils.Size(args.Columns)); 311Host.Assert(NumBitsMin <= ex.NumberOfBits && ex.NumberOfBits < NumBitsLim); 323Host.Assert(ex.SlotMap[i].Distinct().Count() == ex.SlotMap[i].Length); 324Host.Assert(ex.SlotMap[i].All(slot => 0 <= slot && slot < Infos[iColumn].TypeSrc.GetValueCount())); 340Host.Assert(Utils.Size(slotMap) >= 1); 411Host.Assert(0 <= iinfo && iinfo < Infos.Length); 470Host.Assert(0 <= iinfo && iinfo < Infos.Length); 505Host.Assert(!(Infos[iinfo].TypeSrc is VectorDataViewType)); 530Host.Assert(srcType != null); 578Host.Assert(srcType != null); 579Host.Assert(Utils.Size(_exes[iinfo].SlotMap) == 1); 655Host.Assert(iinfo >= 0 && iinfo < _exes.Length);
KeyToVectorMapping.cs (15)
178Host.Assert(_bitsPerKey[i] > 0); 209Host.Assert(colIndex >= 0); 281Host.Assert(0 <= iinfo && iinfo < _infos.Length); 282Host.Assert(_types[iinfo].IsKnownSize); 287Host.Assert(srcVectorSize > 1); 305Host.Assert(slotLim == (long)srcVectorSize * _bitsPerKey[iinfo]); 331Host.Assert(slot == slotLim); 339Host.Assert(0 <= iinfo && iinfo < _infos.Length); 354Host.Assert(_infos[iinfo].TypeSrc is KeyDataViewType); 357Host.Assert(bitsPerKey == _types[iinfo].Size); 360Host.Assert(dstLength > 0); 362Host.Assert(srcCol >= 0); 385Host.Assert(typeSrc.ItemType is KeyDataViewType); 388Host.Assert(cv >= 0); 390Host.Assert(srcCol >= 0);
LearnerFeatureSelection.cs (1)
271host.Assert(options.Threshold.HasValue != options.NumSlotsToKeep.HasValue);
LoadTransform.cs (1)
122h.Assert(currentView is IDataTransform);
MissingValueDroppingTransformer.cs (8)
244Host.Assert(!isNA(in def)); 264Host.Assert(newCount <= srcValues.Length); 277Host.Assert(dst.GetValues().Length == newCount); 292Host.Assert(iDst == newCount); 308Host.Assert(newCount <= srcValues.Length); 334Host.Assert(iDst == newCount); 355Host.Assert(iDst == newCount); 356Host.Assert(offset == srcValues.Length - newCount);
MissingValueIndicatorTransform.cs (15)
80Host.Assert(Infos.Length == Utils.Size(args.Columns)); 171Host.Assert(0 <= iinfo && iinfo < Infos.Length); 177Host.Assert(0 <= iinfo && iinfo < Infos.Length); 188Host.Assert(_types[iinfo].Size == 2); 195Host.Assert(srcVectorType.IsKnownSize); 196Host.Assert(size == 2 * srcVectorType.Size); 215Host.Assert(0 <= slot && slot < size); 216Host.Assert(slot % 2 == 0); 231Host.Assert(slot == size); 241Host.Assert(0 <= iinfo && iinfo < Infos.Length); 264Host.Assert(dst.Length == 2); 308ectx.Assert(iivDst <= ivSrc); 333ectx.Assert(iivDst <= iivSrc); 338ectx.Assert(ivPrev < iv && iv < size); 354ectx.Assert(0 <= iivDst && iivDst <= values.Length);
MissingValueIndicatorTransformer.cs (13)
209Host.Assert(colIndex >= 0); 238Host.Assert(0 <= iinfo && iinfo < _infos.Length); 373Host.Assert(dstCount <= srcLength); 391Host.Assert(0 <= i && i <= iNext); 392Host.Assert(iiSrc + iiDst == i); 395Host.Assert(iiDst < dstCount); 401Host.Assert(iiSrc + 1 < indices.Count); 402Host.Assert(iNext < indices[iiSrc + 1]); 406Host.Assert(srcLength == iiSrc + iiDst); 407Host.Assert(iiDst == dstCount); 423Host.Assert(0 <= i && i <= indices[ii]); 428Host.Assert(ii < indices.Count); 429Host.Assert(indices[ii - 1] < indices[ii]);
MissingValueReplacing.cs (30)
249Host.Assert(repValue.GetType() == _replaceTypes[i].RawType || repValue.GetType() == _replaceTypes[i].GetItemType().RawType); 255Host.Assert(srcType != null); 256Host.Assert(srcType.Size == src.Length); 268Host.Assert(valReturn.Length == src.Length); 318Host.Assert(false); 369Host.Assert(values.Length == type.GetVectorSize()); 489Host.Assert(type.RawType == typeof(T) || type.GetItemType().RawType == typeof(T)); 510Host.Assert(repValue is Array); 516Host.Assert(!(repValue is Array)); 519Host.Assert(repValue.GetType() == _replaceTypes[iinfo].RawType || repValue.GetType() == _replaceTypes[iinfo].GetItemType().RawType); 614Host.Assert(colIndex >= 0); 625Host.Assert(0 <= iinfo && iinfo < _infos.Length); 647Host.Assert(_parent._repValues[iinfo] is T); 680Host.Assert(_parent._repValues[iinfo] is T); 692Host.Assert(_parent._repValues[iinfo] is T[]); 725Host.Assert(srcSize == srcCount); 743Host.Assert(srcCount < srcSize); 750Host.Assert(iivDst <= iivSrc); 753Host.Assert(ivPrev < iv && iv < srcSize); 768Host.Assert(iivDst <= srcCount); 770Host.Assert(0 <= iivDst); 771Host.Assert(repIsDefault || iivDst == srcCount); 781Host.Assert(rep.Length == src.Length); 783Host.Assert(repIsDefault.Length == src.Length); 799Host.Assert(srcSize == srcCount); 817Host.Assert(srcCount < srcSize); 824Host.Assert(iivDst <= iivSrc); 827Host.Assert(ivPrev < iv && iv < srcSize); 842Host.Assert(iivDst <= srcCount); 844Host.Assert(0 <= iivDst);
MissingValueReplacingUtils.cs (14)
19ch.Assert(type.GetItemType() is NumberDataViewType); 99ch.Assert(false); 189Ch.Assert(0 <= col); 238Ch.Assert(type.IsKnownSize); 351Ch.Assert(0 <= slot && slot < Stat.Length); 550Ch.Assert(float.MinValue <= val && val <= float.MaxValue); 570Ch.Assert(float.MinValue <= val && val <= float.MaxValue); 584Ch.Assert(0 <= slot && slot < Stat.Length); 594Ch.Assert(float.MinValue <= val && val <= float.MaxValue); 666Ch.Assert(0 <= slot && slot < Stat.Length); 673Ch.Assert(0 <= slot && slot < Stat.Length); 806Ch.Assert(0 <= slot && slot < Stat.Length); 884Ch.Assert(0 <= slot && slot < Stat.Length); 894Ch.Assert(0 <= slot && slot < Stat.Length);
OptionalColumnTransform.cs (2)
489Ch.Assert(originFn != null); 520Host.Assert(((ICanSaveOnnx)this).CanSaveOnnx(ctx));
ProduceIdTransform.cs (2)
198Ch.Assert(index == 0); 217Ch.Assert(index == 0);
RandomFourierFeaturizing.cs (1)
367Host.Assert(count == distances.Length);
StatefulCustomMappingTransformer.cs (2)
276Ch.Assert(active == null || active.Length == parent.OutputSchema.Count); 322Ch.Assert(originFn != null);
SvmLight\SvmLightLoader.cs (6)
475Ch.Assert(_isActive); 510Ch.Assert(-1 <= _fileIdx && _fileIdx < _parent._files.Count); 572_host.Assert(_featureCount <= int.MaxValue); 583_host.Assert(keyCol.HasValue); 678env.Assert(col.HasValue); 721env.Assert(schemaDef.Count == 1);
Text\LdaTransform.cs (4)
248ectx.Assert(numVocab >= 0); 827ch.Assert(states.Length == columns.Length); 922ch.Assert(numDocArray[i] < rowCount); 965env.Assert(corpusSize[i] == docSizeCheck[i]);
Text\NgramHashingTransformer.cs (3)
553Host.Assert(0 <= lim && lim <= Utils.Size(ngram)); 554Host.Assert(Utils.Size(ngram) == ngramLength); 555Host.Assert(icol >= 0);
Text\NgramTransform.cs (19)
245env.Assert(srcTypes[iinfo] is VectorDataViewType vectorType && vectorType.ItemType is KeyDataViewType); 329env.Assert(counts[i] >= 0); 330env.Assert(counts[i] <= lims[i]); 335env.Assert(count == pool.Count); 341env.Assert(lims.Count > 0); 342env.Assert(lims.Count == Utils.Size(counts)); 349env.Assert(0 < lim && lim <= Utils.Size(ngram)); 350env.Assert(lim <= Utils.Size(counts)); 351env.Assert(lim <= lims.Count); 352env.Assert(icol == 0); 527Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 528Host.Assert(InputSchema[_srcCols[iinfo]].HasKeyValues()); 547Host.Assert(n >= 0); 562Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 563Host.Assert(InputSchema[_srcCols[iinfo]].HasKeyValues()); 596Host.Assert(n >= 0); 636Host.Assert(keyCount > 0); 661Host.Assert(0 < lim && lim <= Utils.Size(ngram)); 662Host.Assert(lim <= Utils.Size(_parent._transformInfos[iinfo].NonEmptyLevels));
Text\StopWordsRemovingTransformer.cs (8)
396Host.Assert(colIndex >= 0); 405Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 795ch.Assert(isBinary != isTranspose); 802ch.Assert(isTranspose); 957Host.Assert(_stopWordsMap.Count > 0); 962Host.Assert(nstr.Id == id); 1090Host.Assert(colIndex >= 0); 1099Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length);
Text\TextNormalizing.cs (6)
263Host.Assert(colIndex >= 0); 329Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 333Host.Assert(srcType.GetItemType() is TextDataViewType); 337Host.Assert(vectorType.Size >= 0); 438Host.Assert(i == src.Length); 442Host.Assert(src.Length == len);
Text\TokenizingByCharacters.cs (3)
299Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 315Host.Assert(bldr.Length == boundaries[boundaries.Length - 1]); 467Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length);
Text\WordEmbeddingsExtractor.cs (5)
112ch.Assert(wordVector.Length == Dimension); 546Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 554Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 557Host.Assert(column.Type is VectorDataViewType); 558Host.Assert(column.Type.GetItemType() is TextDataViewType);
Text\WordTokenizing.cs (3)
228Host.Assert(colIndex >= 0); 237Host.Assert(0 <= iinfo && iinfo < _parent._columns.Length); 242Host.Assert(srcType.GetItemType() is TextDataViewType);
UngroupTransform.cs (8)
286_ectx.Assert(_pivotIndex[info.Index] == -1); 403_ectx.Assert(0 <= iinfo && iinfo < _infos.Length); 409_ectx.Assert(0 <= col && col < _inputSchema.Count); 410_ectx.Assert(_pivotIndex[col] >= 0); 421_ectx.Assert(0 <= col && col < _inputSchema.Count); 513Ch.Assert(_fixedSize > 0 || _sizeGetters.Length > 0); 531Ch.Assert(Position < 0 || (0 <= _pivotColPosition && _pivotColPosition < _pivotColSize)); 643Ch.Assert(cachedPosition <= Input.Position);
Microsoft.ML.Vision (4)
DnnRetrainTransform.cs (3)
139env.Assert(actualRead == fileLength); 722Host.Assert(actualWritten == fileLength); 864Host.Assert(type == _parent._outputTypes[iinfo].GetItemType().RawType);
ImageClassificationTrainer.cs (1)
1363Host.Assert(classCount > 1);