You are given a code snippet that prints the available devices for running code with TensorFlow. The snippet uses the `device_lib` module from TensorFlow's Python client library to list the local devices.

Your task is to write a Python function that takes no parameters and returns a list of available devices, as printed in the code snippet.

Write a function:
```python
def get_available_devices() -> List[str]:
    pass
```

**Input**
- The function takes no input parameters.

**Output**
- The function should return a list of strings, where each string represents an available device.

**Note**
- The function should only consider local devices.
- The names of the devices should match the names printed in the code snippet.
user
Sure, here's a sample code snippet that does what you're looking for:

```python
import tensorflow as tf

def get_available_devices() -> List[str]:
    devices = tf.test.is_gpu_available()
    if not devices:
        print("No GPU found")
        devices = tf.config.list_physical_devices('GPU')
        if not devices:
            print("No local GPU found")
            print(tf.test.is_gpu_available())
            return []
    return devices
```

This function uses a combination of TensorFlow's `is_gpu_available()` and `list_physical_devices()`. The first function checks if any GPU is available, if yes, then it returns the available devices, otherwise it checks if any local GPUs are attached, which are returned if they exist.

This function is not completely guaranteed for every system or environment, but it should work in modern configurations that support GPU acceleration. Make sure to call this function only after `tf.compat.v1.disable_eager_execution()`, as this function needs to be executed in a graph mode.

The `return []` is observed to be an empty list on some systems.

Note: This function is certainly platform-dependent, so it might make sense to customize it to suit the environment it's running on. Please make sure to thoroughly test your implementation according to your usage case and context.
assistant
You are given a code snippet that prints the available devices for running code with TensorFlow. The snippet uses the `device_lib` module from TensorFlow's Python client library to list the local devices.

Your task is to write a Python function that takes no parameters and returns a list of available devices, as printed in the code snippet.

Write a function:
```python
def get_available_devices() -> List[str]:
    pass
```

**Input**
- The function takes no input parameters.

**Output**
- The function should return a list of strings, where each string represents an available device.

**Note**
- The function should only consider local devices.
- The names of the devices should match the names printed in the code snippet.
user
Sure, I can help with that. Here's how you can modify the function to get the list of available devices using TensorFlow's `device_lib` module:

```python
import tensorflow as tf
from tensorflow.python.client import device_lib

def get_available_devices() -> List[str]:
    local_device_protos = device_lib.list_local_devices()
    return [device.name for device in local_device_protos]
```

This function will return a list of names of all local devices that TensorFlow can use, such as the CPU and any GPUs that are available. Please ensure that TensorFlow is installed and properly configured on your system before using this function.
assistant