# tf.config.experimental.get_memory_growth

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/config/experimental/get_memory_growth) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/framework/config.py#L409-L431) |

Get if memory growth is enabled for a PhysicalDevice.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.config.experimental.get_memory_growth`](https://www.tensorflow.org/api_docs/python/tf/config/experimental/get_memory_growth), \`tf.compat.v2.config.experimental.get_memory_growth\`

<br />

    tf.config.experimental.get_memory_growth(
        device
    )

A PhysicalDevice with memory growth set will not allocate all memory on the
device upfront.

#### For example:

    physical_devices = config.experimental.list_physical_devices('GPU')
    assert len(physical_devices) > 0, "Not enough GPU hardware devices available"
    tf.config.experimental.set_memory_growth(physical_devices[0], True)
    assert tf.config.experimental.get_memory_growth(physical_devices[0]) == True

<br />

<br />

<br />

| ## Args ||
|---|---|
| `device` | PhysicalDevice to query |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Current memory growth setting. ||

<br />