tf.config.get_logical_device_configuration
Get the virtual device configuration for a tf.config.PhysicalDevice
.
tf.config.get_logical_device_configuration(
device
)
Returns the list of tf.config.LogicalDeviceConfiguration
objects previously configured by a call to
tf.config.set_logical_device_configuration
.
For example:
physical_devices = tf.config.list_physical_devices('CPU')
assert len(physical_devices) == 1, "No CPUs found"
configs = tf.config.get_logical_device_configuration(
physical_devices[0])
try:
assert configs is None
tf.config.set_logical_device_configuration(
physical_devices[0],
[tf.config.LogicalDeviceConfiguration(),
tf.config.LogicalDeviceConfiguration()])
configs = tf.config.get_logical_device_configuration(
physical_devices[0])
assert len(configs) == 2
except:
# Cannot modify virtual devices once initialized.
pass
Args |
device
|
PhysicalDevice to query
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[]]