tf.config.experimental.get_memory_growth
Проверяет, включено ли увеличение объема памяти для PhysicalDevice.
tf.config.experimental.get_memory_growth(
device
)
Если для PhysicalDevice включено увеличение объема памяти, при инициализации среды выполнения вся память устройства не выделяется.
Например:
physical_devices = tf.config.list_physical_devices('GPU')
try:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
assert tf.config.experimental.get_memory_growth(physical_devices[0])
except:
# Invalid device or cannot modify virtual devices once initialized.
pass| Аргументы | |
|---|---|
device | PhysicalDevice для запроса |
| Возвращает | |
|---|---|
Логическое значение, указывающее, включено ли увеличение объема памяти для PhysicalDevice. |
| Вызывает исключение | |
|---|---|
ValueError | Указан недопустимый PhysicalDevice. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/config/experimental/get_memory_growth