forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigImpl.cs
More file actions
27 lines (24 loc) · 835 Bytes
/
ConfigImpl.cs
File metadata and controls
27 lines (24 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Collections.Generic;
using System.Text;
using static Tensorflow.Binding;
using Tensorflow.Device;
namespace Tensorflow.Framework
{
public class ConfigImpl
{
/// <summary>
/// Return a list of physical devices visible to the host runtime.
/// </summary>
/// <param name="device_type">CPU, GPU, TPU</param>
/// <returns></returns>
public PhysicalDevice[] list_physical_devices(string device_type = null)
=> tf.Context.list_physical_devices(device_type: device_type);
public Experimental experimental => new Experimental();
public class Experimental
{
public void set_memory_growth(PhysicalDevice device, bool enable)
=> tf.Context.set_memory_growth(device, enable);
}
}
}