220 references to Check
Microsoft.Data.Analysis.Tests (2)
Microsoft.ML.AutoML (3)
Microsoft.ML.Core (42)
EntryPoints\ModuleArgs.cs (14)
165Contracts.Check(_inf == null,
167Contracts.Check(_max == null || ((IComparable)_max).CompareTo(value) != -1,
169Contracts.Check(_sup == null || ((IComparable)_sup).CompareTo(value) == 1,
184Contracts.Check(_sup == null,
186Contracts.Check(_min == null || ((IComparable)_min).CompareTo(value) != 1,
188Contracts.Check(_inf == null || ((IComparable)_inf).CompareTo(value) == -1,
203Contracts.Check(_min == null,
205Contracts.Check(_max == null || ((IComparable)_max).CompareTo(value) == 1,
207Contracts.Check(_sup == null || ((IComparable)_sup).CompareTo(value) == 1,
222Contracts.Check(_max == null,
224Contracts.Check(_min == null || ((IComparable)_min).CompareTo(value) == -1,
226Contracts.Check(_inf == null || ((IComparable)_inf).CompareTo(value) == -1,
237Contracts.Check(val is IComparable, "Type for range attribute must support IComparable");
241Contracts.Check(_type == val.GetType(), "All Range attribute values must be of the same type");
Microsoft.ML.Data (83)
Data\Conversion.cs (12)
489Contracts.Check(type.RawType == typeof(TSrc), "Wrong TSrc type argument");
543Contracts.Check(typeDst.RawType == typeof(TDst), "Wrong TDst type parameter");
1227Contracts.Check((I1)res == res, "Overflow or underflow occurred while converting value in text to sbyte.");
1246Contracts.Check((I2)res == res, "Overflow or underflow occurred while converting value in text to short.");
1265Contracts.Check((I4)res == res, "Overflow or underflow occurred while converting value in text to int.");
1454Contracts.Check(res.HasValue, "Value could not be parsed from text to sbyte.");
1455Contracts.Check((I1)res == res, "Overflow or underflow occurred while converting value in text to sbyte.");
1462Contracts.Check(res.HasValue, "Value could not be parsed from text to short.");
1463Contracts.Check((I2)res == res, "Overflow or underflow occurred while converting value in text to short.");
1470Contracts.Check(res.HasValue, "Value could not be parsed from text to int.");
1471Contracts.Check((I4)res == res, "Overflow or underflow occurred while converting value in text to int.");
1478Contracts.Check(res.HasValue, "Value could not be parsed from text to long.");
Deprecated\Vector\VectorUtils.cs (11)
25Contracts.Check(Utils.Size(a) == Utils.Size(b), "Arrays must have the same length");
32Contracts.Check(Utils.Size(a) == b.Length, "Vectors must have the same dimensionality.");
43Contracts.Check(a.Length == b.Length, "Vectors must have the same dimensionality.");
162Contracts.Check(a.Length == dst.Length, "Vectors must have the same dimensionality.");
254Contracts.Check(b.Length <= a.Length - offset, "VBuffer b must be no longer than a.Length - offset.");
306Contracts.Check(b.Length <= a.Length - offset, "VBuffer b must be no longer than a.Length - offset.");
396Contracts.Check(a.Length == b.Length, "Vectors must have the same dimensionality.");
417Contracts.Check(Utils.Size(a) == b.Length, "Vectors must have the same dimensionality.");
472Contracts.Check(src.Length <= dst.Length - offset, "Vector src must be no longer than dst.Length - offset.");
499Contracts.Check(src.Length == dst.Length, "Arrays must have the same dimensionality.");
543Contracts.Check(a.Length == b.Length, "Arrays must have the same dimensionality.");
Transforms\MetadataDispatcher.cs (11)
107Contracts.Check(type.RawType == typeof(TValue), "Incompatible types");
129Contracts.Check(type.RawType == typeof(TValue), "Incompatible types");
161Contracts.Check(!_sealed, "MetadataDispatcher sealed");
162Contracts.Check(schemaSrc == null || (0 <= indexSrc && indexSrc < schemaSrc.Count), "indexSrc out of range");
163Contracts.Check(filterSrc == null || schemaSrc != null, "filterSrc should be null if schemaSrc is null");
174Contracts.Check(!_sealed, "MetadataDispatcher sealed");
206Contracts.Check(_sealed, "MetadataDispatcher not sealed");
252Contracts.Check(_sealed, "MetadataDispatcher not sealed");
400Contracts.Check(tmp == null, "Duplicate building of metadata");
409Contracts.Check(_md != null, "Builder disposed");
425Contracts.Check(_md != null, "Builder disposed");
Microsoft.ML.Ensemble (2)
Microsoft.ML.EntryPoints (3)
Microsoft.ML.FastTree (16)
Microsoft.ML.KMeansClustering (1)
Microsoft.ML.LightGbm (1)
Microsoft.ML.OnnxConverter (1)
Microsoft.ML.PCA (1)
Microsoft.ML.StandardTrainers (16)
Microsoft.ML.Sweeper (14)
Parameters.cs (14)
221Contracts.Check(options.Min < options.Max, "min must be less than max");
223Contracts.Check(!options.LogBase || options.Min > 0, "min must be positive if log scale is used");
224Contracts.Check(!options.LogBase || options.StepSize == null || options.StepSize > 1, "StepSize must be greater than 1 if log scale is used");
225Contracts.Check(options.LogBase || options.StepSize == null || options.StepSize > 0, "StepSize must be greater than 0 if linear scale is used");
316Contracts.Check(valueTyped != null, "LongValueGenerator could not normalized parameter because it is not of the correct type");
317Contracts.Check(_options.Min <= valueTyped.Value && valueTyped.Value <= _options.Max, "Value not in correct range");
331Contracts.Check(valueTyped != null, "Parameter should be of type LongParameterValue");
353Contracts.Check(options.Min < options.Max, "min must be less than max");
355Contracts.Check(!options.LogBase || options.Min > 0, "min must be positive if log scale is used");
356Contracts.Check(!options.LogBase || options.StepSize == null || options.StepSize > 1, "StepSize must be greater than 1 if log scale is used");
357Contracts.Check(options.LogBase || options.StepSize == null || options.StepSize > 0, "StepSize must be greater than 0 if linear scale is used");
440Contracts.Check(valueTyped != null, "FloatValueGenerator could not normalized parameter because it is not of the correct type");
441Contracts.Check(_options.Min <= valueTyped.Value && valueTyped.Value <= _options.Max, "Value not in correct range");
455Contracts.Check(valueTyped != null, "Parameter should be of type FloatParameterValue");
Microsoft.ML.TensorFlow (5)
Microsoft.ML.TestFramework (4)
Microsoft.ML.TimeSeries (10)
Microsoft.ML.Transforms (16)