1 write to _env
Microsoft.ML.Data (1)
Model\ModelOperationsCatalog.cs (1)
28
_env
= env;
39 references to _env
Microsoft.ML.Data (39)
Model\ModelOperationsCatalog.cs (39)
22
IHostEnvironment IInternalCatalog.Environment =>
_env
;
41
_env
.CheckValue(loader, nameof(loader));
42
_env
.CheckValueOrNull(model);
43
_env
.CheckValue(stream, nameof(stream));
50
using (var rep = RepositoryWriter.CreateNew(stream,
_env
))
67
_env
.CheckValueOrNull(model);
68
_env
.CheckValue(loader, nameof(loader));
69
_env
.CheckNonEmpty(filePath, nameof(filePath));
85
_env
.CheckValueOrNull(model);
86
_env
.CheckValueOrNull(inputSchema);
87
_env
.CheckValue(stream, nameof(stream));
89
using (var rep = RepositoryWriter.CreateNew(stream,
_env
))
114
_env
.CheckValueOrNull(model);
115
_env
.CheckValueOrNull(inputSchema);
116
_env
.CheckNonEmpty(filePath, nameof(filePath));
124
_env
.AssertValueOrNull(inputSchema);
125
_env
.AssertValue(rep);
130
using (var ch =
_env
.Start("Saving Schema"))
133
var saver = new BinarySaver(
_env
, new BinarySaver.Arguments { Silent = true });
134
DataSaverUtils.SaveDataView(ch, saver, new EmptyDataView(
_env
, inputSchema), entry.Stream, keepHidden: true);
154
_env
.CheckValue(stream, nameof(stream));
156
using (var rep = RepositoryReader.Open(stream,
_env
))
161
var loader = new BinaryLoader(
_env
, new BinaryLoader.Arguments(), entry.Stream);
163
ModelLoadContext.LoadModel<ITransformer, SignatureLoadModel>(
_env
, out var transformerChain, rep,
168
ModelLoadContext.LoadModelOrNull<IDataLoader<IMultiStreamSource>, SignatureLoadModel>(
_env
, out var dataLoader, rep, null);
172
if (ModelLoadContext.LoadModelOrNull<ITransformer, SignatureLoadModel>(
_env
, out var transformerChain, rep,
182
var loader = ModelFileUtils.LoadLoader(
_env
, rep, new MultiFileSource(null), false);
184
return TransformerChain.LoadFromLegacy(
_env
, stream);
188
throw
_env
.Except(ex, "Could not load legacy format model");
213
_env
.CheckNonEmpty(filePath, nameof(filePath));
226
_env
.AssertValue(loader);
260
_env
.CheckValue(stream, nameof(stream));
266
ModelLoadContext.LoadModel<IDataLoader<IMultiStreamSource>, SignatureLoadModel>(
_env
, out loader, rep, null);
271
throw
_env
.Except(ex, "Model does not contain an " + nameof(IDataLoader<IMultiStreamSource>) +
288
_env
.CheckNonEmpty(filePath, nameof(filePath));
317
return transformer.CreatePredictionEngine<TSrc, TDst>(
_env
, ignoreMissingColumns, inputSchemaDefinition, outputSchemaDefinition);
333
return transformer.CreatePredictionEngine<TSrc, TDst>(
_env
, false,
334
DataViewConstructionUtils.GetSchemaDefinition<TSrc>(
_env
, inputSchema));
350
return transformer.CreatePredictionEngine<TSrc, TDst>(
_env
, options.IgnoreMissingColumns,