1 write to Ch
Microsoft.ML.Core (1)
Data\RootCursorBase.cs (1)
41
Ch
= provider.Start("Cursor");
278 references to Ch
Microsoft.ML.Core (5)
Data\LinkedRootCursorBase.cs (1)
33
Ch
.AssertValue(input, nameof(input));
Data\LinkedRowRootCursorBase.cs (3)
26
Ch
.CheckValue(schema, nameof(schema));
27
Ch
.Check(active == null || active.Length == schema.Count);
37
Ch
.Check(column.Index < Schema.Count);
Data\RootCursorBase.cs (1)
52
Ch
.Dispose();
Microsoft.ML.Data (219)
Data\DataViewUtils.cs (34)
1031
Ch
.AssertValue(schema);
1032
Ch
.AssertValue(activeToCol);
1033
Ch
.AssertValue(colToActive);
1034
Ch
.AssertValue(pipes);
1035
Ch
.AssertValue(batchInputs);
1036
Ch
.AssertValueOrNull(quitAction);
1037
Ch
.Assert(colToActive.Length == schema.Count);
1038
Ch
.Assert(activeToCol.Length + (int)ExtraIndex._Lim == pipes.Length);
1039
Ch
.Assert(pipes.All(p => p != null));
1072
Ch
.Assert(!_disposed);
1079
Ch
.Assert(pipe.Remaining == _remaining);
1095
Ch
.Assert(nextBatch.HasException || nextBatch.BatchId > Batch);
1096
Ch
.Assert(nextBatch.HasException || nextBatch.Count > 0);
1102
Ch
.Assert(!nextBatch.HasException);
1112
Ch
.CheckParam(column.Index < _colToActive.Length, nameof(column));
1125
Ch
.CheckParam(IsColumnActive(column), nameof(column), "requested column not active.");
1126
Ch
.CheckParam(column.Index < _colToActive.Length, nameof(column), "requested column is not active or valid for the Schema.");
1131
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
1185
Ch
.CheckNonEmpty(cursors, nameof(cursors));
1206
Ch
.Assert(cursor.Position < 0);
1237
Ch
.Check(_icursor >= 0, RowCursorUtils.FetchValueStateError);
1254
Ch
.AssertValue(cursor);
1255
Ch
.Assert(col < cursor.Schema.Count);
1256
Ch
.Assert(cursor.IsColumnActive(Schema[col]));
1257
Ch
.Assert(type.Equals(cursor.Schema[col].Type));
1263
Ch
.Check(_icursor >= 0, RowCursorUtils.FetchValueStateError);
1271
Ch
.Assert(!_disposed);
1280
Ch
.Assert(_currentCursor.Batch > _batch);
1290
Ch
.Assert(Position < 0 || stats.Batch > _batch);
1294
Ch
.Assert(stats.Batch == _currentCursor.Batch);
1303
Ch
.CheckParam(column.Index < _colToActive.Length, nameof(column));
1316
Ch
.CheckParam(IsColumnActive(column), nameof(column), "requested column not active");
1317
Ch
.CheckParam(column.Index < _colToActive.Length, nameof(column), "requested column not active or is invalid for the schema. ");
1322
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
Data\RowCursorUtils.cs (9)
554
Ch
.AssertValue(parent);
555
Ch
.AssertValue(active);
556
Ch
.Assert(active.Length == parent.Schema.Count);
572
Ch
.CheckParam(column.Index < Schema.Count, nameof(column));
573
Ch
.CheckParam(IsColumnActive(column), nameof(column.Index), "Requested column is not active.");
579
Ch
.Check(IsGood, "Cannot call value getter in current state");
589
Ch
.CheckParam(column.Index < Schema.Count, nameof(column));
592
Ch
.Assert(_parent._row.IsColumnActive(column));
601
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
DataLoadSave\Binary\BinaryLoader.cs (15)
1250
Ch
.AssertValueOrNull(rand);
1367
_exMarshaller.ThrowIfSet(
Ch
);
1447
protected IExceptionContext Ectx { get { return Parent.
Ch
; } }
1564
Contracts.AssertValue(parent.
Ch
);
1969
Ch
.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column));
1975
Ch
.Assert(!_disposed);
2002
_exMarshaller.ThrowIfSet(
Ch
);
2011
Ch
.Assert(more == pipeMoved);
2037
Ch
.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column), "requested column not active.");
2042
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
2056
ValueGetter<T> del = (ref T value) => throw
Ch
.Except(RowCursorUtils.FetchValueStateError);
2067
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
2086
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
2090
Ch
.Assert(pos / _rowsPerBlock < _blockShuffleOrder.Length);
2093
Ch
.Assert(0 <= blockPos && blockPos < _parent.RowCount);
DataLoadSave\Database\DatabaseLoaderCursor.cs (9)
38
Ch
.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count);
39
Ch
.CheckValue(source, nameof(source));
52
Ch
.Assert(_getters[i] != null);
110
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
147
Ch
.Check(column.Index < _bindings.Infos.Length);
160
Ch
.CheckParam(column.Index < _getters.Length, nameof(column), "requested column not valid.");
161
Ch
.Check(IsColumnActive(column));
166
throw
Ch
.Except($"Invalid TValue in GetGetter: '{typeof(TValue)}', " +
181
Ch
.Assert(colInfo.ColType.RawType == typeof(TValue));
DataLoadSave\Text\TextLoaderCursor.cs (18)
89
Ch
.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count);
90
Ch
.AssertValue(reader);
91
Ch
.AssertValue(stats);
92
Ch
.Assert(srcNeeded >= 0);
93
Ch
.Assert(cthd > 0);
118
Ch
.Assert(v != null);
120
Ch
.Assert(_getters[i] != null);
204
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
306
Ch
.Check(column.Index < _bindings.Infos.Length);
319
Ch
.CheckParam(column.Index < _getters.Length, nameof(column), "requested column not valid.");
320
Ch
.Check(IsColumnActive(column));
325
throw
Ch
.Except($"Invalid TValue in GetGetter: '{typeof(TValue)}', " +
332
Ch
.AssertValue(_rows);
333
Ch
.Assert(_rows.Count == 1);
339
Ch
.Assert(batch.Exception == null);
343
Ch
.Assert(info.Line > 0);
344
Ch
.AssertNonEmpty(info.Text);
839
throw
Ch
.ExceptDecode(state.ParsingException,
DataLoadSave\Transpose\TransposeLoader.cs (17)
763
Ch
.AssertValue(columnsNeeded);
766
Ch
.AssertValue(_parent._colTransposers);
767
Ch
.AssertValue(_parent._colTransposersLock);
768
Ch
.Assert(!_parent.HasRowData);
796
Ch
.Assert(0 <= col && col < Schema.Count);
797
Ch
.Assert(_colToActivesIndex[col] >= 0);
799
Ch
.Assert(((ITransposeDataView)_parent).GetSlotType(col).Size == _parent._header.RowCount);
814
Ch
.Assert(typeof(T) == type.RawType);
823
Ch
.Assert(buff.Length == 1);
834
Ch
.Assert(type is VectorDataViewType);
835
Ch
.Assert(typeof(T) == type.GetItemType().RawType);
849
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
861
Ch
.Assert(cMore == more);
871
Ch
.CheckParam(column.Index <= _colToActivesIndex.Length, nameof(column));
884
Ch
.CheckParam(column.Index <= _colToActivesIndex.Length && IsColumnActive(column), nameof(column), "requested column not active");
885
Ch
.AssertValue(_getters[_colToActivesIndex[column.Index]]);
890
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
DataView\AppendRowsDataView.cs (22)
175
Ch
.AssertNonEmpty(Sources);
183
Ch
.AssertValue(colType);
191
Ch
.CheckParam(column.Index <= Getters.Length && IsColumnActive(column), nameof(column), "requested column not active");
196
throw
Ch
.Except($"Invalid TValue in GetGetter: '{typeof(TValue)}', " +
206
Ch
.Check(column.Index < Schema.Count, "Column index is out of range");
248
Ch
.AssertValue(_currentCursor);
255
Ch
.Check(Position >= 0, RowCursorUtils.FetchValueStateError);
258
Ch
.Assert(0 <= _currentSourceIndex && _currentSourceIndex < Sources.Length);
259
Ch
.Assert(_currentCursor != null);
269
Ch
.AssertValue(_currentCursor);
292
Ch
.Dispose();
316
Ch
.AssertValue(rand);
319
Ch
.AssertValue(counts);
320
Ch
.Assert(Sources.Length == counts.Length);
324
Ch
.Assert(counts[i] >= 0);
327
_sampler = new MultinomialWithoutReplacementSampler(
Ch
, counts, rand);
342
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
354
Ch
.Check(Position >= 0, RowCursorUtils.FetchValueStateError);
355
Ch
.Assert(0 <= _currentSourceIndex && _currentSourceIndex < Sources.Length);
371
Ch
.Assert(pos < _cursorSet.Length);
374
Ch
.Assert(r);
384
Ch
.Dispose();
DataView\ArrayDataViewBuilder.cs (13)
268
Ch
.AssertValue(view);
269
Ch
.AssertValueOrNull(rand);
270
Ch
.Assert(view.Schema.Count >= 0);
292
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
301
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
312
Ch
.Check(column.Index < Schema.Count);
325
Ch
.Check(column.Index < Schema.Count);
326
Ch
.Check(column.Index < _active.Length && _active[column.Index], "the requested column is not active");
331
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
337
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
344
Ch
.Assert(Position < _view._rowCount);
350
Ch
.Assert(IsGood);
351
Ch
.Assert(0 <= Position && Position < _view._rowCount);
DataView\BatchDataViewMapperBase.cs (7)
120
Ch
.AssertValue(_getters);
122
Ch
.Assert(getter != null);
125
throw
Ch
.Except($"Invalid TValue in GetGetter: '{typeof(TValue)}', " +
135
Ch
.Check(IsGood, "Cannot call ID getter in current state");
142
Ch
.Check(column.Index < _parent.SchemaBindings.AsSchema.Count);
156
Ch
.Assert(_lastInBatchInLookAheadCursorDel());
161
Ch
.Assert(good);
DataView\EmptyDataView.cs (4)
55
Ch
.AssertValue(schema);
62
return (ref DataViewRowId val) => throw
Ch
.Except(RowCursorUtils.FetchValueStateError);
81
Ch
.CheckParam(IsColumnActive(column), nameof(column), "requested column not active");
82
return (ref TValue value) => throw
Ch
.Except(RowCursorUtils.FetchValueStateError);
DataView\LambdaFilter.cs (1)
167
Ch
.Assert(typeof(T1) == typeof(T2));
DataView\Transposer.cs (9)
1489
Ch
.CheckParam(column.Index == 0, nameof(column));
1502
Ch
.CheckParam(column.Index == 0, nameof(column));
1503
Ch
.CheckParam(_getter != null, nameof(column), "requested column not active");
1507
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
1516
Ch
.Check(_slotCursor.SlotIndex >= 0, RowCursorUtils.FetchValueStateError);
1550
Ch
.CheckParam(column.Index == 0, nameof(column));
1563
Ch
.CheckParam(column.Index == 0, nameof(column));
1564
return _slotCursor.GetGetterWithVectorType<TValue>(
Ch
);
1571
Ch
.Check(_slotCursor.SlotIndex >= 0, RowCursorUtils.FetchValueStateError);
DataView\ZipDataView.cs (3)
120
Ch
.AssertNonEmpty(srcCursors);
121
Ch
.AssertValue(predicate);
146
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
Transforms\BootstrapSamplingTransformer.cs (2)
198
Ch
.AssertValue(rgen);
236
Ch
.Assert(_remaining >= 0);
Transforms\NAFilter.cs (3)
404
Ch
.Check(IsColumnActive(column));
420
Ch
.Assert(IsColumnActive(Schema[col]));
432
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
Transforms\PerGroupTransformBase.cs (11)
252
Ch
.AssertValue(parent);
255
Ch
.AssertValue(input);
256
Ch
.AssertValue(groupCursor);
257
Ch
.AssertValue(active);
280
Ch
.Check(column.Index < _parent.GetBindings().ColumnCount);
303
Ch
.AssertValue(_getters);
305
Ch
.Assert(getter != null);
308
throw
Ch
.Except($"Invalid TValue in GetGetter: '{typeof(TValue)}', " +
318
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
337
Ch
.Assert(good);
339
Ch
.Assert(_groupCursor.Position >= 0);
Transforms\RangeFilter.cs (15)
319
Ch
.Check(0 <= column.Index && column.Index < Schema.Count);
320
Ch
.Check(IsColumnActive(column));
327
throw
Ch
.Except($"Invalid TValue in GetGetter: '{typeof(TValue)}', " +
357
Ch
.Assert(Parent._type == NumberDataViewType.Single);
362
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
369
Ch
.Assert(Parent._type == NumberDataViewType.Single);
375
Ch
.Assert(Parent._type == NumberDataViewType.Single);
390
Ch
.Assert(Parent._type == NumberDataViewType.Double);
395
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
402
Ch
.Assert(Parent._type == NumberDataViewType.Double);
408
Ch
.Assert(Parent._type == NumberDataViewType.Double);
425
Ch
.Assert(Parent._type.GetKeyCount() > 0);
431
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
440
Ch
.Assert(Parent._type is KeyDataViewType);
446
Ch
.Assert(Parent._type is KeyDataViewType);
Transforms\RowShufflingTransformer.cs (25)
505
Ch
.AssertValue(input);
506
Ch
.AssertValue(rand);
508
Ch
.Assert(_blockSize > 0);
509
Ch
.Assert(_bufferDepth > 0);
510
Ch
.Assert(poolRows > 0);
582
Ch
.Assert(requested >= _blockSize);
586
Ch
.Assert(0 <= circularIndex && circularIndex < _pipeIndices.Length);
590
Ch
.Assert(0 <= pipeIndex && pipeIndex < _pipeIndices.Length);
618
Ch
.Assert(_liveCount > 0);
619
Ch
.Assert(_deadCount < _blockSize || _doneConsuming);
620
Ch
.Assert(0 <= _circularIndex && _circularIndex < _pipeIndices.Length);
651
throw
Ch
.Except(_producerTaskException, "Shuffle input cursor reader failed with an exception");
671
Ch
.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column));
672
Ch
.Assert((_colToActivesIndex[column.Index] >= 0) == _input.IsColumnActive(column));
678
Ch
.Assert(0 <= col && col < _colToActivesIndex.Length);
679
Ch
.Assert(_colToActivesIndex[col] >= 0);
685
Ch
.Assert(0 <= col && col < _colToActivesIndex.Length);
686
Ch
.Assert(_colToActivesIndex[col] >= 0);
687
Ch
.Assert(Schema[col].Type.RawType == typeof(TValue));
693
Ch
.AssertValue(pipe);
694
Ch
.Assert(pipe is ShufflePipe<TValue>);
699
Ch
.Assert(_pipeIndex == _pipeIndices[_circularIndex]);
714
Ch
.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column));
715
Ch
.CheckParam(_colToActivesIndex[column.Index] >= 0, nameof(column), "requested column not active");
720
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
Transforms\SkipTakeFilter.cs (2)
241
Ch
.Assert(skip >= 0);
242
Ch
.Assert(take >= 0);
Microsoft.ML.Parquet (24)
ParquetLoader.cs (11)
451
Ch
.AssertValue(columnsNeeded);
452
Ch
.AssertValue(parent._parquetStream);
456
_parquetConversions = new ParquetConversions(
Ch
);
491
Ch
.CheckParam(IsColumnActive(Schema[col]), nameof(col));
539
Ch
.CheckParam(IsColumnActive(Schema[col]), nameof(col));
540
Ch
.CheckValue(valueConverter, nameof(valueConverter));
546
Ch
.Check(Position >= 0, RowCursorUtils.FetchValueStateError);
600
Ch
.CheckParam(IsColumnActive(column), nameof(column), "requested column not active");
605
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
617
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
627
Ch
.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column));
PartitionedFileLoader.cs (13)
422
Ch
.Check(IsColumnActive(column));
427
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
438
Ch
.Check(IsGood, RowCursorUtils.FetchValueStateError);
449
Ch
.Check(column.Index < Schema.Count);
478
Ch
.Warning($"Failed to load file {path} due to a loader exception. Moving on to the next file. Ex: {e.Message}");
492
Ch
.Warning(MessageSensitivity.Schema, e.Message);
522
Ch
.Warning($"File at index {_fileOrder.Current} is missing a path. Loading of file is being skipped.");
609
Ch
.Check(col >= 0 && col < SubColumnCount);
626
Ch
.Check(col >= 0 && col < _colValues.Length);
627
Ch
.AssertValue(type);
632
throw
Ch
.Except("Invalid TValue: '{0}' of the conversion.", typeof(TValue));
707
Ch
.Warning($"Path {path} did not have {dirCount} directories necessary for parsing.");
735
Ch
.Warning($"Could not parse column values from the path {path}. Ex: {e.Message}");
Microsoft.ML.Transforms (30)
GroupTransform.cs (8)
518
Ch
.AssertValue(predicate);
568
Ch
.CheckParam(column.Index < _active.Length, nameof(column));
581
Ch
.Assert(_leadingCursor.Position >= 0);
595
Ch
.Assert(groupSize > 0);
605
Ch
.Assert(res);
652
throw
Ch
.ExceptParam(nameof(column), "Column #{0} is not active", column);
660
Ch
.AssertValue(_aggregators[column.Index - _groupCount]);
661
return _aggregators[column.Index - _groupCount].GetGetter<TValue>(
Ch
);
StatefulFilterTransform.cs (5)
146
Ch
.AssertValue(input);
147
Ch
.AssertValue(columnsNeeded);
156
CursorChannelAttribute.TrySetCursorChannel(_parent._host, _src,
Ch
);
157
CursorChannelAttribute.TrySetCursorChannel(_parent._host, _dst,
Ch
);
158
CursorChannelAttribute.TrySetCursorChannel(_parent._host, _state,
Ch
);
SvmLight\SvmLightLoader.cs (10)
474
Ch
.Check(IsGood, "cannot call getter with cursor in its current state");
475
Ch
.Assert(_isActive);
481
Ch
.CheckParam(column.Index == 0, nameof(column));
482
Ch
.CheckParam(_isActive, nameof(column), "requested column not active");
486
throw
Ch
.Except($"Invalid TValue: '{typeof(TValue)}', " +
496
Ch
.Check(IsGood, "Cannot call ID getter in current state");
503
Ch
.CheckParam(column.Index == 0, nameof(column));
509
Ch
.AssertValue(_currReader);
510
Ch
.Assert(-1 <= _fileIdx && _fileIdx < _parent._files.Count);
524
Ch
.AssertValue(_parent._files);
UngroupTransform.cs (7)
513
Ch
.Assert(_fixedSize > 0 || _sizeGetters.Length > 0);
531
Ch
.Assert(Position < 0 || (0 <= _pivotColPosition && _pivotColPosition < _pivotColSize));
601
Ch
.Check(column.Index < _ungroupBinding.InputColumnCount);
614
Ch
.CheckParam(column.Index < _ungroupBinding.InputColumnCount, nameof(column));
623
Ch
.Check(result != null, "Unexpected getter type requested");
641
Ch
.Check(Input.Position >= 0, RowCursorUtils.FetchValueStateError);
643
Ch
.Assert(cachedPosition <= Input.Position);