1 write to _host
Microsoft.ML.Data (1)
DataLoadSave\Binary\BinarySaver.cs (1)
193
_host
= env.Register("BinarySaver");
50 references to _host
Microsoft.ML.Data (50)
DataLoadSave\Binary\BinarySaver.cs (50)
195
_host
.CheckUserArg(!args.MaxRowsPerBlock.HasValue || args.MaxRowsPerBlock > 0, nameof(args.MaxRowsPerBlock), "Must be positive.");
196
_host
.CheckUserArg(!args.MaxBytesPerBlock.HasValue || args.MaxBytesPerBlock > 0, nameof(args.MaxBytesPerBlock), "Must be positive.");
198
_host
.CheckUserArg(args.MaxRowsPerBlock.HasValue || args.MaxBytesPerBlock.HasValue, nameof(args.MaxBytesPerBlock),
202
_factory = new CodecFactory(
_host
, _memPool);
217
_host
.AssertValue(toCompress);
218
_host
.AssertValue(toWrite);
219
_host
.Assert(columns > 0);
220
_host
.Assert(_deterministicBlockOrder == (waiter != null));
263
_host
.AssertValue(writer);
264
_host
.AssertValue(schema);
265
_host
.Assert(0 <= col && col < schema.Count);
283
_host
.Check(!string.IsNullOrEmpty(metaColumn.Name), "Metadata with null or empty kind detected, disallowed");
284
_host
.Check(metaColumn.Type != null, "Metadata with null type detected, disallowed");
286
throw
_host
.Except("Metadata with duplicate kind '{0}' encountered, disallowed", metaColumn.Name, schema[col].Name);
298
_host
.CheckIO(offsets[offsets.Count - 1] > offsets[offsets.Count - 2], "Bad offsets detected during write");
304
_host
.CheckIO(writer.BaseStream.Position == offsets[0], "unexpected offset after no writing of metadata");
328
_host
.CheckIO(writer.BaseStream.Position == expectedPosition, "unexpected offsets after metadata table of contents kind");
331
_host
.CheckIO(writer.BaseStream.Position == expectedPosition, "unexpected offsets after metadata table of contents type description");
342
_host
.CheckIO(writer.BaseStream.Position == expectedPosition, "unexpected offsets after metadata table of contents location");
344
_host
.Assert(metadataInfos.Count == offsets.Count - 1);
352
_host
.Assert(typeof(T) == type.RawType);
375
_host
.Assert(tmp);
388
_host
.Assert(tmp);
399
_host
.AssertValue(exMarshaller);
402
_host
.AssertValue(cp);
645
_host
.CheckValue(stream, nameof(stream));
646
_host
.CheckValue(data, nameof(data));
647
_host
.CheckValueOrNull(colIndices);
648
_host
.CheckParam(stream.CanWrite, nameof(stream), "cannot save to non-writable stream");
649
_host
.CheckParam(stream.CanSeek, nameof(stream), "cannot save to non-seekable stream");
650
_host
.CheckParam(stream.Position == 0, nameof(stream), "stream must be positioned at head of stream");
652
using (IChannel ch =
_host
.Start("Saving"))
679
() => WriteWorker(stream, toWrite, activeColumns, data.Schema, rowsPerBlock,
_host
, exMarshaller));
687
using (var pch = _silent ? null :
_host
.StartProgressChannel("BinarySaver"))
692
_host
.Assert(compressionTask != null || toCompress.IsCompleted);
709
_host
.AssertValue(schema);
710
_host
.AssertValueOrNull(colIndices);
721
throw
_host
.Except("Could not get codec for requested column {0} of type {1}", schema[c].Name, type);
722
_host
.Assert(type.Equals(codec.Type));
733
_host
.Assert(_maxRowsPerBlock.HasValue && _maxRowsPerBlock.Value > 0); // argument validation should have ensured this
740
Random rand = data.CanShuffle ? new TauswortheHybrid(
_host
.Rand) : null;
783
_host
.AssertValue(codec);
807
_host
.CheckValue(stream, nameof(stream));
808
_host
.CheckValue(type, nameof(type));
831
_host
.CheckValue(stream, nameof(stream));
849
_host
.CheckValue(stream, nameof(stream));
850
_host
.CheckValue(type, nameof(type));
851
_host
.CheckParam(value.GetType() == type.RawType, nameof(value), "Value doesn't match type");
884
_host
.CheckValue(stream, nameof(stream));
904
_host
.Assert(typeof(T) == codec.Type.RawType);