2 writes to Host
Microsoft.ML.Data (2)
Transforms\TransformBase.cs (2)
33Host = env.Register(name); 42Host = host;
435 references to Host
Microsoft.ML.Data (255)
DataView\LambdaColumnMapper.cs (11)
111Host.Assert(typeDst.RawType == typeof(T3)); 112Host.AssertValue(map1); 113Host.Assert(map2 != null || typeof(T2) == typeof(T3)); 127bldr.AddGetter(AnnotationUtils.Kinds.KeyValues, new VectorDataViewType(TextDataViewType.Instance, _typeDst.GetItemType().GetKeyCountAsInt32(Host)), mdGetter); 132Host.Assert(vectorSize > 0); 144Host.Assert(false, "Shouldn't serialize this!"); 145throw Host.ExceptNotSupp("Shouldn't serialize this"); 150Host.Assert(iinfo == 0); 156Host.AssertValueOrNull(ch); 157Host.AssertValue(input); 158Host.Assert(iinfo == 0);
DataView\LambdaFilter.cs (11)
89Host.AssertValue(pred); 90Host.Assert(conv != null || typeof(T1) == typeof(T2)); 91Host.Assert(0 <= colSrc && colSrc < Source.Schema.Count); 100Host.Assert(false, "Shouldn't serialize this!"); 101throw Host.ExceptNotSupp("Shouldn't serialize this"); 106Host.AssertValue(predicate); 113Host.AssertValueOrNull(rand); 127Host.CheckValueOrNull(rand); 134Host.AssertNonEmpty(inputs); 145Host.AssertValue(predicate); 162: base(parent.Host, input, parent.OutputSchema, active)
DataView\RowToRowMapperTransform.cs (17)
133Host.CheckValue(ctx, nameof(ctx)); 183Host.AssertValue(predicate, "predicate"); 194return new Cursor(Host, Source.GetRowCursor(inputCols, rand), this, active); 199Host.CheckValueOrNull(rand); 205Host.AssertNonEmpty(inputs); 208inputs = DataViewUtils.CreateSplitCursors(Host, inputs[0], n); 209Host.AssertNonEmpty(inputs); 213cursors[i] = new Cursor(Host, inputs[i], this, active); 219Host.CheckValue(ctx, nameof(ctx)); 222Host.Check(onnx.CanSaveOnnx(ctx), "Cannot be saved as ONNX."); 229Host.CheckValue(ctx, nameof(ctx)); 232Host.Check(pfa.CanSavePfa, "Cannot be saved as PFA."); 251Host.CheckValue(input, nameof(input)); 252Host.CheckValue(activeColumns, nameof(activeColumns)); 253Host.Check(input.Schema == Source.Schema, "Schema of input row must be the same as the schema the mapper is bound to"); 255using (var ch = Host.Start("GetEntireRow")) 260Host.Assert(column.Index < activeArr.Length, $"The columns {activeColumns.Select(c => c.Name)} are not suitable for the OutputSchema.");
Dirty\ChooseColumnsByIndexTransform.cs (9)
200Host.CheckValue(options, nameof(options)); 208Host.AssertValue(ctx); 227Host.CheckValue(ctx, nameof(ctx)); 240Host.AssertValue(predicate); 247Host.AssertValueOrNull(rand); 255return new Cursor(Host, _bindings, input, active); 260Host.CheckValueOrNull(rand); 269Host.AssertNonEmpty(inputs); 274cursors[i] = new Cursor(Host, _bindings, inputs[i], active);
Scorers\BinaryClassifierScorer.cs (8)
186Host.CheckValue(ctx, nameof(ctx)); 187Host.Assert(Bindable is IBindableCanSaveOnnx); 188Host.Assert(Bindings.InfoCount >= 2); 193Host.Assert(delta == 1); 220Host.Assert(predictedLabelCol.HasValue); 234Host.AssertValue(output); 235Host.Assert(output.Schema == Bindings.RowMapper.OutputSchema); 236Host.Assert(output.IsColumnActive(output.Schema[Bindings.ScoreColumnIndex]));
Scorers\ClusteringScorer.cs (1)
103int keyCount = Bindings.PredColType is KeyDataViewType key ? key.GetCountAsInt32(Host) : 0;
Scorers\GenericScorer.cs (17)
157Host.CheckValue(args, nameof(args)); 158Host.AssertValue(data, "data"); 159Host.AssertValue(mapper, "mapper"); 162Host.CheckParam(rowMapper != null, nameof(mapper), "mapper should implement ISchemaBoundRowMapper"); 212Host.CheckValue(ctx, nameof(ctx)); 213Host.Assert(Bindable is IBindableCanSavePfa); 217Host.Assert(_bindings.DerivedColumnCount == 0); 227Host.CheckValue(ctx, nameof(ctx)); 228Host.Assert(Bindable is IBindableCanSaveOnnx); 232Host.Assert(_bindings.DerivedColumnCount == 0); 251Host.AssertValue(predicate, "predicate"); 259Host.CheckValue(env, nameof(env)); 260Host.CheckValue(newSource, nameof(newSource)); 267Host.Assert(_bindings.DerivedColumnCount == 0); 268Host.AssertValue(output); 269Host.AssertValue(predicate); 270Host.Assert(output.Schema == _bindings.RowMapper.OutputSchema);
Scorers\MulticlassClassificationScorer.cs (6)
564Host.AssertValue(output); 565Host.Assert(output.Schema == Bindings.RowMapper.OutputSchema); 566Host.Assert(output.IsColumnActive(output.Schema[Bindings.ScoreColumnIndex])); 572int scoreLength = Bindings.PredColType.GetKeyCountAsInt32(Host); 578Host.Check(score.Length == scoreLength); 589Host.Check(score.Length == scoreLength);
Scorers\PredictedLabelScorerBase.cs (26)
287Host.CheckValue(args, nameof(args)); 288Host.CheckNonEmpty(scoreColKind, nameof(scoreColKind)); 289Host.CheckNonEmpty(scoreColName, nameof(scoreColName)); 290Host.CheckValue(outputTypeMatches, nameof(outputTypeMatches)); 291Host.CheckValue(getPredColType, nameof(getPredColType)); 294Host.CheckParam(rowMapper != null, nameof(mapper), "mapper should implement " + nameof(ISchemaBoundRowMapper)); 298throw Host.ExceptParam(nameof(scoreColName), "mapper does not contain a column '{0}'", scoreColName); 301Host.Check(outputTypeMatches(scoreType), "Unexpected predictor output type"); 321Host.AssertValue(ctx); 322Host.AssertValue(host); 323Host.AssertValue(outputTypeMatches); 324Host.AssertValue(getPredColType); 332Host.AssertValue(ctx); 338Host.CheckValue(ctx, nameof(ctx)); 339Host.Assert(Bindable is IBindableCanSavePfa); 344Host.Assert(delta == 1); 371Host.CheckValue(ctx, nameof(ctx)); 372Host.Assert(Bindable is IBindableCanSaveOnnx); 378Host.Assert(delta == 1); 398Host.AssertValue(predicate); 406Host.Assert(Bindings.DerivedColumnCount == 1); 407Host.AssertValue(output); 408Host.AssertValue(predicate); 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 (5)
117Host.AssertValue(predicate); 139return new Cursor(Host, this, input, active, activeMapperColumns); 144Host.CheckValueOrNull(rand); 156inputs = DataViewUtils.CreateSplitCursors(Host, inputs[0], n); 161cursors[i] = new Cursor(Host, this, inputs[i], active, activeMapperColumns);
Transforms\BootstrapSamplingTransformer.cs (8)
81Host.CheckValue(options, nameof(options)); 82Host.CheckUserArg(options.PoolSize >= 0, nameof(options.PoolSize), "Cannot be negative"); 85_state = new TauswortheHybrid.State(options.Seed ?? (uint)Host.Rand.Next()); 128Host.CheckDecode(_poolSize >= 0); 133Host.CheckValue(ctx, nameof(ctx)); 149Host.Assert(_poolSize >= 0); 175cursor = RowShufflingTransformer.GetShuffledCursor(Host, _poolSize, cursor, new TauswortheHybrid(rgen)); 196: base(parent.Host, input)
Transforms\GenerateNumberTransform.cs (12)
281Host.CheckValue(options, nameof(options)); 282Host.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns)); 290Host.AssertValue(ctx); 296Host.CheckDecode(cbFloat == sizeof(float)); 312Host.CheckValue(ctx, nameof(ctx)); 329Host.AssertValue(predicate, "predicate"); 339Host.AssertValueOrNull(rand); 347return new Cursor(Host, _bindings, input, active); 352Host.CheckValueOrNull(rand); 364Host.AssertNonEmpty(inputs); 370cursors[i] = new Cursor(Host, _bindings, inputs[i], active); 378return new DataViewRowCursor[] { new Cursor(Host, _bindings, input, active) };
Transforms\LabelConvertTransform.cs (6)
125Host.CheckValue(ctx, nameof(ctx)); 132Host.AssertNonEmpty(Infos); 185Host.Assert(0 <= iinfo && iinfo < Infos.Length); 198Host.Assert(0 <= iinfo && iinfo < Infos.Length); 199Host.AssertValue(Infos[iinfo].SlotTypeSrc); 202return new SlotCursorImpl(Host, cursor, GetSlotTypeCore(iinfo));
Transforms\LabelIndicatorTransform.cs (9)
102Host.CheckValue(ctx, nameof(ctx)); 137Host.AssertNonEmpty(Infos); 138Host.Assert(Infos.Length == Utils.Size(options.Columns)); 150Host.AssertValue(ctx); 151Host.AssertNonEmpty(Infos); 163Host.Assert(0 <= iinfo && iinfo < Infos.Length); 170Host.AssertValue(ch); 181Host.AssertValue(ch); 226throw Host.ExceptNotSupp($"Label column type is not supported for binary remapping: {info.TypeSrc}. Supported types: key, float, double.");
Transforms\NAFilter.cs (21)
96Host.CheckValue(args, nameof(args)); 97Host.CheckValue(input, nameof(input)); 98Host.CheckUserArg(Utils.Size(args.Columns) > 0, nameof(args.Columns)); 99Host.CheckValue(env, nameof(env)); 110throw Host.ExceptUserArg(nameof(args.Columns), "Source column '{0}' not found", src); 112throw Host.ExceptUserArg(nameof(args.Columns), "Source column '{0}' specified multiple times", src); 116throw Host.ExceptUserArg(nameof(args.Columns), $"Column '{src}' has type {type} which does not support missing values, so we cannot filter on them", src); 126Host.CheckValue(ctx, nameof(ctx)); 134Host.CheckDecode(cbFloat == sizeof(Single) || cbFloat == sizeof(Double)); 136Host.CheckDecode(cinfo > 0); 146throw Host.ExceptSchemaMismatch(nameof(schema), "source", src); 148throw Host.Except("Source column '{0}' specified multiple times", src); 152throw Host.ExceptSchemaMismatch(nameof(schema), "source", src, "scalar or vector of float, double or KeyType", type.ToString()); 171Host.CheckValue(ctx, nameof(ctx)); 180Host.Assert(_infos.Length > 0); 202Host.AssertValue(predicate); 209Host.AssertValueOrNull(rand); 221Host.CheckValueOrNull(rand); 228Host.AssertNonEmpty(inputs); 239Host.AssertValue(predicate); 387: base(parent.Host, input, parent.OutputSchema, active)
Transforms\RangeFilter.cs (17)
98Host.CheckValue(options, nameof(options)); 102throw Host.ExceptUserArg(nameof(options.Column), "Source column '{0}' not found", options.Column); 104using (var ch = Host.Start("Checking parameters")) 137Host.CheckValue(ctx, nameof(ctx)); 147Host.CheckDecode(cbFloat == sizeof(float)); 152throw Host.ExceptSchemaMismatch(nameof(schema), "source", column); 156throw Host.ExceptSchemaMismatch(nameof(schema), "source", column, "Single, Double or Key", _type.ToString()); 161throw Host.Except("min", "min must be less than or equal to max"); 179Host.CheckValue(ctx, nameof(ctx)); 193Host.Assert(_min < _max); 203Host.AssertValue(predicate); 210Host.AssertValueOrNull(rand); 223Host.CheckValueOrNull(rand); 230Host.AssertNonEmpty(inputs); 245Host.Assert(_type is KeyDataViewType); 251Host.AssertValue(predicate); 275: base(parent.Host, input, parent.OutputSchema, active)
Transforms\RowShufflingTransformer.cs (12)
113Host.CheckValue(options, nameof(options)); 115Host.CheckUserArg(options.PoolRows > 0, nameof(options.PoolRows), "pool size must be positive"); 120Host.CheckUserArg(!(_poolOnly && _forceShuffleSource), 124_forceShuffleSeed = options.ForceShuffleSeed ?? Host.Rand.NextSigned(); 132Host.AssertValue(ctx); 142Host.CheckDecode(_poolRows > 0); 146Host.CheckDecode(!(_poolOnly && _forceShuffleSource)); 164Host.CheckValue(ctx, nameof(ctx)); 247Host.AssertValue(predicate, "predicate"); 253Host.AssertValueOrNull(rand); 287return new Cursor(Host, _poolRows, input, rand); 292Host.CheckValueOrNull(rand);
Transforms\SkipTakeFilter.cs (9)
91Host.Assert(skip >= 0); 92Host.Assert(take >= 0); 171Host.CheckValue(ctx, nameof(ctx)); 178Host.Assert(_skip >= 0); 180Host.Assert(_take >= 0); 207Host.AssertValue(predicate, "predicate"); 213Host.AssertValueOrNull(rand); 217return new Cursor(Host, input, OutputSchema, activeColumns, _skip, _take); 222Host.CheckValueOrNull(rand);
Transforms\TransformBase.cs (50)
67Host.CheckValueOrNull(rand); 80DataViewUtils.TryCreateConsolidatingCursor(out curs, this, columnsNeeded, Host, rng)) 149Host.CheckValue(ctx, nameof(ctx)); 178Host.CheckValue(input, nameof(input)); 179Host.CheckValue(activeColumns, nameof(activeColumns)); 180Host.Check(input.Schema == Source.Schema, "Schema of input row must be the same as the schema the mapper is bound to"); 182using (var ch = Host.Start("GetEntireRow")) 320Contracts.AssertValue(parent.Host); 331var host = parent.Host; 368var host = parent.Host; 469_parent.Metadata.GetMetadata<TValue>(_parent.Host, kind, iinfo, ref value); 502Host.CheckUserArg(Utils.Size(column) > 0, nameof(column)); 503Host.CheckValueOrNull(testType); 516Host.CheckUserArg(Utils.Size(column) > 0, nameof(column)); 517Host.CheckValueOrNull(testType); 530Host.CheckValue(ctx, nameof(ctx)); 531Host.CheckValueOrNull(testType); 547Host.CheckValueOrNull(checkType); 569Host.CheckValue(ctx, nameof(ctx)); 575Host.CheckValue(ctx, nameof(ctx)); 576Host.Assert(((ICanSavePfa)this).CanSavePfa); 605Host.CheckValue(ctx, nameof(ctx)); 606Host.Assert(((ICanSaveOnnx)this).CanSaveOnnx(ctx)); 641Host.AssertValue(ctx); 642Host.Assert(0 <= iinfo && iinfo < _bindings.InfoCount); 643Host.Assert(Infos[iinfo] == info); 644Host.AssertValue(srcToken); 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); 696Host.AssertValue(input); 697Host.Assert(0 <= iinfo && iinfo < Infos.Length); 699Host.Assert(input.IsColumnActive(input.Schema[src])); 705Host.CheckValue(typeDst, nameof(typeDst)); 706Host.CheckValue(row, nameof(row)); 718Host.AssertValue(predicate, "predicate"); 736Host.AssertValueOrNull(rand); 743return new Cursor(Host, this, input, active); 748Host.CheckValueOrNull(rand); 754Host.AssertNonEmpty(inputs); 757inputs = DataViewUtils.CreateSplitCursors(Host, inputs[0], n); 758Host.AssertNonEmpty(inputs); 763cursors[i] = new Cursor(Host, this, inputs[i], active); 773Host.Assert(0 <= col && col < _bindings.ColumnCount); 774return Host.ExceptParam(nameof(col), "Bad call to GetSlotCursor on untransposable column '{0}'", 780Host.CheckParam(0 <= col && col < _bindings.ColumnCount, nameof(col)); 806Host.Assert(false); 807throw Host.ExceptNotImpl("Data view indicated it could transpose a column, but apparently it could not"); 830using (var ch = Host.Start("CreateGetters"))
Microsoft.ML.TimeSeries (77)
ExponentialAverageTransform.cs (6)
63Host.CheckUserArg(0 <= args.Decay && args.Decay <= 1, nameof(args.Decay), "Should be in [0, 1]."); 76Host.CheckDecode(0 <= _decay && _decay <= 1); 77Host.CheckDecode(WindowSize == 1); 82Host.CheckValue(ctx, nameof(ctx)); 83Host.Assert(WindowSize >= 1); 84Host.Assert(0 <= _decay && _decay <= 1);
MovingAverageTransform.cs (10)
71Host.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "Should be at least 1."); 72Host.CheckUserArg(args.Lag >= 0, nameof(args.Lag), "Should be positive."); 73Host.CheckUserArg(args.Lag != 0 || args.WindowSize > 1, nameof(args.Lag), 77throw Host.ExceptUserArg(nameof(args.Weights), string.Format("{0} weights are provided, but {1} are expected (or none)'", Utils.Size(_weights), args.WindowSize)); 92Host.CheckDecode(WindowSize >= 1); 93Host.CheckDecode(_weights == null || Utils.Size(_weights) == WindowSize + 1 - _lag); 98Host.CheckValue(ctx, nameof(ctx)); 99Host.Assert(WindowSize >= 1); 100Host.Assert(_lag >= 0); 111Host.Assert(_weights == null || Utils.Size(_weights) == WindowSize + 1 - _lag);
PercentileThresholdTransform.cs (7)
70Host.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "The size of the sliding window should be at least 1."); 71Host.CheckUserArg(MinPercentile <= args.Percentile && args.Percentile <= MaxPercentile, nameof(args.Percentile), "The percentile value should be in [0, 100]."); 83Host.CheckDecode(WindowSize >= 1); 84Host.CheckDecode(MinPercentile <= _percentile && _percentile <= MaxPercentile); 89Host.CheckValue(ctx, nameof(ctx)); 90Host.Assert(MinPercentile <= _percentile && _percentile <= MaxPercentile); 91Host.Assert(WindowSize >= 1);
PValueTransform.cs (4)
75Host.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "The size of the sliding window should be at least 1."); 89Host.CheckDecode(WindowSize >= 1); 94Host.CheckValue(ctx, nameof(ctx)); 95Host.Assert(WindowSize >= 1);
SequentialTransformBase.cs (19)
278Contracts.AssertValue(Host); 279Host.CheckParam(initialWindowSize >= 0, nameof(initialWindowSize), "Must be non-negative."); 280Host.CheckParam(windowSize >= 0, nameof(windowSize), "Must be non-negative."); 283Host.CheckNonEmpty(inputColumnName, nameof(PercentileThresholdTransform.Arguments.Source)); 284Host.CheckNonEmpty(outputColumnName, nameof(PercentileThresholdTransform.Arguments.Source)); 291_transform = CreateLambdaTransform(Host, input, OutputColumnName, InputColumnName, InitFunction, WindowSize > 0, outputColTypeOverride); 297Host.CheckValue(ctx, nameof(ctx)); 307Host.CheckDecode(windowSize >= 0); 310Host.CheckDecode(initialWindowSize >= 0); 320BinarySaver bs = new BinarySaver(Host, new BinarySaver.Arguments()); 323_transform = CreateLambdaTransform(Host, input, OutputColumnName, InputColumnName, InitFunction, WindowSize > 0, ct); 328Host.CheckValue(ctx, nameof(ctx)); 329Host.Assert(InitialWindowSize >= 0); 330Host.Assert(WindowSize >= 0); 345BinarySaver bs = new BinarySaver(Host, new BinarySaver.Arguments()); 349throw Host.ExceptSchemaMismatch(nameof(_transform.Schema), "output", OutputColumnName); 366state.InitState(WindowSize, InitialWindowSize, this, Host); 373Host.AssertValue(predicate); 401: base(parent.Host, input)
SequentialTransformerBase.cs (18)
570return new Cursor(Host, clone, srcCursor); 575Host.AssertValue(predicate); 795Host.CheckValue(ctx, nameof(ctx)); 860Host.AssertValue(predicate, "predicate"); 872return new Cursor(Host, Source.GetRowCursor(inputCols, rand), this, active); 877Host.CheckValueOrNull(rand); 885Host.AssertNonEmpty(inputs); 888inputs = DataViewUtils.CreateSplitCursors(Host, inputs[0], n); 889Host.AssertNonEmpty(inputs); 893cursors[i] = new Cursor(Host, inputs[i], this, active); 899Host.CheckValue(ctx, nameof(ctx)); 902Host.Check(onnx.CanSaveOnnx(ctx), "Cannot be saved as ONNX."); 909Host.CheckValue(ctx, nameof(ctx)); 912Host.Check(pfa.CanSavePfa, "Cannot be saved as PFA."); 930Host.CheckValue(input, nameof(input)); 931Host.CheckValue(activeColumns, nameof(activeColumns)); 932Host.Check(input.Schema == Source.Schema, "Schema of input row must be the same as the schema the mapper is bound to"); 934using (var ch = Host.Start("GetEntireRow"))
SlidingWindowTransform.cs (1)
53Host.CheckValue(ctx, nameof(ctx));
SlidingWindowTransformBase.cs (12)
66Host.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "Must be at least 1."); 67Host.CheckUserArg(args.Lag >= 0, nameof(args.Lag), "Must be positive."); 70Host.Assert(args.WindowSize == 1); 71throw Host.ExceptUserArg(nameof(args.Lag), 74Host.CheckUserArg(Enum.IsDefined(typeof(BeginOptions), args.Begin), nameof(args.Begin), "Undefined value."); 88Host.CheckDecode(WindowSize >= 1); 90Host.CheckDecode(_lag >= 0); 92Host.CheckDecode(Enum.IsDefined(typeof(BeginOptions), r)); 111Host.CheckValue(ctx, nameof(ctx)); 112Host.Assert(WindowSize >= 1); 113Host.Assert(_lag >= 0); 114Host.Assert(Enum.IsDefined(typeof(BeginOptions), _begin));
Microsoft.ML.Transforms (103)
GroupTransform.cs (9)
113Host.CheckValue(options, nameof(options)); 114Host.CheckUserArg(Utils.Size(options.GroupKeys) > 0, nameof(options.GroupKeys), "There must be at least one group key"); 116_groupBinding = new GroupBinding(Host, Source.Schema, options.GroupKeys, options.Columns ?? new string[0]); 132Host.AssertValue(ctx); 141Host.CheckValue(ctx, nameof(ctx)); 160Host.CheckValueOrNull(rand); 168Host.AssertValue(predicate); 176Host.CheckValueOrNull(rand); 516: base(parent.Host)
HashJoiningTransform.cs (34)
201Host.AssertNonEmpty(Infos); 202Host.Assert(Infos.Length == Utils.Size(args.Columns)); 205throw Host.ExceptUserArg(nameof(args.NumberOfBits), "numberOfBits should be between {0} and {1} inclusive", NumBitsMin, NumBitsLim - 1); 211Host.CheckUserArg(NumBitsMin <= numberOfBits && numberOfBits < NumBitsLim, nameof(args.NumberOfBits)); 227Host.AssertValue(ctx); 239Host.AssertNonEmpty(Infos); 245Host.CheckDecode(NumBitsMin <= numberOfBits && numberOfBits < NumBitsLim); 251Host.CheckDecode(slotMapCount >= 0); 256Host.CheckDecode(Infos[i].TypeSrc is VectorDataViewType); 262Host.CheckDecode(Utils.Size(slotMap[j]) > 0); // null array could be returned by the call above 265Host.CheckDecode(slotMap[j].Distinct().Count() == slotMap[j].Length); 266Host.CheckDecode( 291Host.CheckValue(ctx, nameof(ctx)); 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); 359throw Host.Except("Unexpected slot index '{1}' in group {0}. Expected 0 to {2}", i, slotIndices[j], srcSlotCount - 1); 364throw Host.Except("Group '{0}' has duplicate slot indices", parts[i]); 411Host.Assert(0 <= iinfo && iinfo < Infos.Length); 413Host.AssertValue(_exes[iinfo].SlotMap); 468Host.AssertValueOrNull(ch); 469Host.AssertValue(input); 470Host.Assert(0 <= iinfo && iinfo < Infos.Length); 504Host.AssertValue(input); 505Host.Assert(!(Infos[iinfo].TypeSrc is VectorDataViewType)); 528Host.AssertValue(input); 530Host.Assert(srcType != null); 547Host.Check(src.Length == expectedSrcLength); 576Host.AssertValue(input); 578Host.Assert(srcType != null); 579Host.Assert(Utils.Size(_exes[iinfo].SlotMap) == 1); 595Host.Check(src.Length == expectedSrcLength); 655Host.Assert(iinfo >= 0 && iinfo < _exes.Length);
MissingValueIndicatorTransform.cs (20)
79Host.AssertNonEmpty(Infos); 80Host.Assert(Infos.Length == Utils.Size(args.Columns)); 88Host.AssertValue(ctx); 93Host.AssertNonEmpty(Infos); 119Host.CheckValue(ctx, nameof(ctx)); 139Host.Check(type.GetValueCount() < int.MaxValue / 2); 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); 209Host.Check(names.Length == srcVectorType.Size, "Unexpected slot name vector size"); 215Host.Assert(0 <= slot && slot < size); 216Host.Assert(slot % 2 == 0); 231Host.Assert(slot == size); 239Host.AssertValueOrNull(ch); 240Host.AssertValue(input); 241Host.Assert(0 <= iinfo && iinfo < Infos.Length); 252FillValues(Host, ref dst); 264Host.Assert(dst.Length == 2);
OptionalColumnTransform.cs (16)
198_metadata.GetMetadata(_parent.Host, kind, iinfo, ref value); 278Host.CheckValue(args, nameof(args)); 279Host.CheckUserArg(Utils.Size(args.Columns) > 0, nameof(args.Columns)); 287Host.AssertValue(ctx); 306Host.CheckValue(ctx, nameof(ctx)); 312_bindings.Save(Host, ctx); 319Host.AssertValue(predicate, "predicate"); 325Host.AssertValueOrNull(rand); 333return new Cursor(Host, _bindings, input, active); 338Host.CheckValueOrNull(rand); 350Host.AssertNonEmpty(inputs); 356cursors[i] = new Cursor(Host, _bindings, inputs[i], active); 364return new DataViewRowCursor[] { new Cursor(Host, _bindings, input, active) }; 387using (var ch = Host.Start("CreateGetters")) 519Host.CheckValue(ctx, nameof(ctx)); 520Host.Assert(((ICanSaveOnnx)this).CanSaveOnnx(ctx));
ProduceIdTransform.cs (9)
103Host.CheckValue(args, nameof(args)); 104Host.CheckNonWhiteSpace(args.Column, nameof(args.Column)); 112Host.AssertValue(ctx); 131Host.CheckValue(ctx, nameof(ctx)); 142Host.AssertValueOrNull(rand); 150return new Cursor(Host, _bindings, input, active); 155Host.CheckValueOrNull(rand); 163cursors[c] = new Cursor(Host, _bindings, cursors[c], active); 169Host.AssertValue(predicate, "predicate");
StatefulCustomMappingTransformer.cs (7)
116Host.CheckValue(parent, nameof(parent)); 120var dstRow = new DataViewConstructionUtils.InputRow<TDst>(Host, _parent.AddedSchema); 126_typedSrc = TypedCursorable<TSrc>.Create(Host, input, false, null); 141Host.AssertNonEmpty(inputs); 163var dstRow = new DataViewConstructionUtils.InputRow<TDst>(Host, _parent.AddedSchema); 273: base(parent.Host, input) 282var dstRow = new DataViewConstructionUtils.InputRow<TDst>(_parent.Host, _parent._parent.AddedSchema);
UngroupTransform.cs (8)
112Host.CheckValue(options, nameof(options)); 113Host.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns), "There must be at least one pivot column"); 114Host.CheckUserArg(options.Columns.Distinct().Count() == options.Columns.Length, nameof(options.Columns), 117_ungroupBinding = new UngroupBinding(Host, Source.Schema, options.Mode, options.Columns); 133Host.AssertValue(ctx); 142Host.CheckValue(ctx, nameof(ctx)); 187return new Cursor(Host, inputCursor, _ungroupBinding, predicate); 199x => new Cursor(Host, inputCursors[x], _ungroupBinding, predicate));