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"); 286throw _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"); 652using (IChannel ch = _host.Start("Saving")) 679() => WriteWorker(stream, toWrite, activeColumns, data.Schema, rowsPerBlock, _host, exMarshaller)); 687using (var pch = _silent ? null : _host.StartProgressChannel("BinarySaver")) 692_host.Assert(compressionTask != null || toCompress.IsCompleted); 709_host.AssertValue(schema); 710_host.AssertValueOrNull(colIndices); 721throw _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 740Random 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);