Spec-Zone.ru › TensorFlow

tf.config.experimental.get_memory_growth

Получить информацию о том, включен ли рост памяти для PhysicalDevice.

Просмотреть псевдонимы

Псевдонимы для миграции

См. Руководство по миграции для получения дополнительной информации.

tf.compat.v1.config.experimental.get_memory_growth

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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API