Set if memory growth should be enabled for a PhysicalDevice. A PhysicalDevice with memory growth set will not allocate all memory on the device upfront. Memory growth cannot be configured on a PhysicalDevice with virtual devices configured. For example: ```python physical_devices = tf
(device, enable)
| 500 | |
| 501 | @tf_export('config.experimental.set_memory_growth') |
| 502 | def set_memory_growth(device, enable): |
| 503 | """Set if memory growth should be enabled for a PhysicalDevice. |
| 504 | |
| 505 | A PhysicalDevice with memory growth set will not allocate all memory on the |
| 506 | device upfront. Memory growth cannot be configured on a PhysicalDevice with |
| 507 | virtual devices configured. |
| 508 | |
| 509 | For example: |
| 510 | |
| 511 | ```python |
| 512 | physical_devices = tf.config.experimental.list_physical_devices('GPU') |
| 513 | assert len(physical_devices) > 0, "Not enough GPU hardware devices available" |
| 514 | tf.config.experimental.set_memory_growth(physical_devices[0], True) |
| 515 | ``` |
| 516 | |
| 517 | Args: |
| 518 | device: PhysicalDevice to configure |
| 519 | enable: Whether to enable or disable memory growth |
| 520 | """ |
| 521 | context.context().set_memory_growth(device, enable) |
| 522 | |
| 523 | |
| 524 | @tf_export('config.experimental.get_virtual_device_configuration') |
nothing calls this directly
no test coverage detected