public Experiment(Runtime.IHostEnvironment env) { _env = env; _catalog = ModuleCatalog.CreateInstance(_env); _jsonNodes = new List <string>(); _serializer = new JsonSerializer(); _serializer.Converters.Add(new StringEnumConverter()); _helper = new SerializationHelper(); }
public Experiment(Runtime.IHostEnvironment env) { _env = env; AssemblyRegistration.RegisterAssemblies(_env); _catalog = _env.ComponentCatalog; _jsonNodes = new List <string>(); _serializer = new JsonSerializer(); _serializer.Converters.Add(new StringEnumConverter()); _helper = new SerializationHelper(); }
private static (Runtime.IHostEnvironment, int?, bool) GetGpuDeviceId(TransformsCatalog catalog, int?gpuDeviceId, bool fallbackToCpu) { Runtime.IHostEnvironment env = CatalogUtils.GetEnvironment(catalog); if (gpuDeviceId == null && env is Runtime.IHostEnvironmentInternal localEnvironment && localEnvironment.GpuDeviceId != null) { gpuDeviceId = localEnvironment.GpuDeviceId; fallbackToCpu = localEnvironment.FallbackToCpu; } return(env, gpuDeviceId, fallbackToCpu); }