36 references to Assert
Microsoft.ML.AutoML (1)
AutoMLExperiment\AutoMLExperiment.cs (1)
93_context.Assert(maxModel > 0, "maxModel has to be greater than 0");
Microsoft.ML.Core (2)
Data\Repository.cs (2)
160_ectx.Assert(false, "Closing entries should not throw!"); 205_ectx.Assert(false, "Why wasn't the entry found?");
Microsoft.ML.Data (13)
Commands\CrossValidationCommand.cs (1)
528ch.Assert(_scorer == null || _scorer is ICommandLineComponentFactory, "CrossValidationCommand should only be used from the command line.");
Commands\ScoreCommand.cs (1)
111ch.Assert(scorer == null || scorer is ICommandLineComponentFactory, "ScoreCommand should only be used from the command line.");
Commands\TestCommand.cs (1)
115ch.Assert(ImplOptions.Scorer == null || ImplOptions.Scorer is ICommandLineComponentFactory, "TestCommand should only be used from the command line.");
Commands\TrainTestCommand.cs (1)
204ch.Assert(ImplOptions.Scorer == null || ImplOptions.Scorer is ICommandLineComponentFactory, "TrainTestCommand should only be used from the command line.");
DataLoadSave\LegacyCompositeDataLoader.cs (2)
436_host.Assert(transforms[i].Transform.Source == transforms[i - 1].Transform, "Transforms are not linked"); 439_host.Assert(!(srcLoader is LegacyCompositeDataLoader), "Can't have composite source loader");
DataView\CacheDataView.cs (3)
407_host.Assert(_rowCount == -1 || rowCount <= _rowCount, inconsistentError); 419_host.Assert(_rowCount == -1 || rowCount <= _rowCount, inconsistentError); 426_host.Assert(rc == -1 || rc == rowCount, inconsistentError);
DataView\LambdaColumnMapper.cs (1)
144Host.Assert(false, "Shouldn't serialize this!");
DataView\LambdaFilter.cs (1)
100Host.Assert(false, "Shouldn't serialize this!");
DataView\RowToRowMapperTransform.cs (1)
260Host.Assert(column.Index < activeArr.Length, $"The columns {activeColumns.Select(c => c.Name)} are not suitable for the OutputSchema.");
Evaluators\EvaluatorUtils.cs (1)
1399host.Assert(labelNames.IsDense, "Slot names vector must be dense");
Microsoft.ML.Ensemble (1)
Selector\SubsetSelector\BaseSubsetSelector.cs (1)
59Host.Assert(Data != null, "Must call Initialize first!");
Microsoft.ML.FastTree (1)
GamModelParameters.cs (1)
268Host.Assert(0 <= featureIndex && featureIndex < NumberOfShapeFunctions, "Index out of range.");
Microsoft.ML.KMeansClustering (2)
KMeansPlusPlusTrainer.cs (2)
1279ch.Assert(MaxInstancesToAccelerate >= 0, 1658host.Assert(heaps[i].Count <= numSamples, "heaps[i].Count must not be greater than numSamples");
Microsoft.ML.LightGbm (3)
LightGbmMulticlassTrainer.cs (2)
215Host.Assert(_numberOfClassesIncludingNan > 1, "Must know the number of classes before creating a predictor."); 216Host.Assert(TrainedEnsemble.NumTrees % _numberOfClassesIncludingNan == 0, "Number of trees should be a multiple of number of classes.");
LightGbmTrainerBase.cs (1)
728ch.Assert(((ITrainer)this).PredictionKind != PredictionKind.MulticlassClassification || GbmOptions.ContainsKey("num_class"),
Microsoft.ML.StandardTrainers (3)
Standard\ModelStatistics.cs (3)
250Env.Assert(coeffStdError.Length > 0, nameof(coeffStdError)); 251Env.Assert(weights.Length > 0, nameof(weights)); 435Env.Assert(names.Length > 0, "FeatureColumnName has no metadata.");
Microsoft.ML.Sweeper (1)
Algorithms\SmacSweeper.cs (1)
130_host.Assert(view.GetRowCount() == targets.Length, "This data view will have as many rows as there have been evaluations");
Microsoft.ML.TimeSeries (2)
TrajectoryMatrix.cs (2)
70_ectx.Assert(0 <= end && end < _seriesLength, "The end index must be in [0, seriesLength)."); 71_ectx.Assert(0 <= start && start <= end, "The start index must be in [0, end index].");
Microsoft.ML.Transforms (7)
Expression\LambdaBinder.cs (2)
186_host.Assert(_lambda == null, "Can't support nested lambdas"); 1538_host.Assert(false, "Unexpected type in Convert");
ExpressionTransformer.cs (2)
446ectx.Assert(false, "Unsupported src cardinality"); 588ectx.Assert(false, "Unsupported src cardinality");
GcnTransform.cs (2)
424Host.Assert(false, "Unsupported normalizer type"); 468Host.Assert(false, "Unsupported normalizer type");
Text\LdaTransform.cs (1)
452ectx.Assert(actualSize == 2 * docSize + 1, string.Format("The doc size are distinct. Actual: {0}, Expected: {1}", actualSize, 2 * docSize + 1));