# tf.config.LogicalDeviceConfiguration

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/eager/context.py#L259-L276) |

Configuration class for a logical devices.

#### View aliases


**Main aliases**

[`tf.config.experimental.VirtualDeviceConfiguration`](https://www.tensorflow.org/api_docs/python/tf/config/LogicalDeviceConfiguration)
**Compat aliases for migration**

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

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

<br />

    tf.config.LogicalDeviceConfiguration(
        memory_limit=None
    )

The class specifies the parameters to configure a [`tf.config.PhysicalDevice`](https://www.tensorflow.org/versions/r2.1/api_docs/python/tf/config/PhysicalDevice)
as it is initialized to a [`tf.config.LogicalDevice`](https://www.tensorflow.org/versions/r2.1/api_docs/python/tf/config/LogicalDevice) during runtime
initialization. Not all fields are valid for all device types.

See [`tf.config.get_logical_device_configuration`](https://www.tensorflow.org/versions/r2.1/api_docs/python/tf/config/get_logical_device_configuration) and
[`tf.config.set_logical_device_configuration`](https://www.tensorflow.org/versions/r2.1/api_docs/python/tf/config/set_logical_device_configuration) for usage examples.

#### Fields:

- **`memory_limit`**: (optional) Maximum memory (in MB) to allocate on the virtual device. Currently only supported for GPUs.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `memory_limit` | <br /> <br /> |

<br />