獲取 tf.config.PhysicalDevice
的虛擬設備配置。
用法
tf.config.get_logical_device_configuration(
device
)
參數
-
device
PhysicalDevice
進行查詢
返回
-
tf.config.LogicalDeviceConfiguration
對象列表或None
如果沒有為此物理設備設置虛擬設備配置。
返回先前通過調用 tf.config.set_logical_device_configuration
配置的 tf.config.LogicalDeviceConfiguration
對象列表。
例如:
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
相關用法
- Python tf.config.get_visible_devices用法及代碼示例
- Python tf.config.list_logical_devices用法及代碼示例
- Python tf.config.experimental.get_memory_usage用法及代碼示例
- Python tf.config.list_physical_devices用法及代碼示例
- Python tf.config.experimental.get_memory_info用法及代碼示例
- Python tf.config.run_functions_eagerly用法及代碼示例
- Python tf.config.experimental.enable_tensor_float_32_execution用法及代碼示例
- Python tf.config.experimental_connect_to_cluster用法及代碼示例
- Python tf.config.experimental.set_memory_growth用法及代碼示例
- Python tf.config.experimental_connect_to_host用法及代碼示例
- Python tf.config.set_visible_devices用法及代碼示例
- Python tf.config.set_logical_device_configuration用法及代碼示例
- Python tf.config.experimental.enable_op_determinism用法及代碼示例
- Python tf.config.experimental.get_device_details用法及代碼示例
- Python tf.config.experimental.ClusterDeviceFilters用法及代碼示例
- Python tf.config.experimental.reset_memory_stats用法及代碼示例
- Python tf.config.experimental.get_memory_growth用法及代碼示例
- Python tf.concat用法及代碼示例
- Python tf.convert_to_tensor用法及代碼示例
- Python tf.constant_initializer.from_config用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.config.get_logical_device_configuration。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。