import torch


def get_activation_layer(name: str) -> torch.nn.Module:
    """
    Get an activation layer with the given name.

    Parameters
    -----------
    name: str
        activation layer name, choose from 'relu' or 'tanh'

    Returns
    -------
    torch.nn.Module:
        activation layer

    Raises
    ------
    ValueError:
        if an unsupported activation layer is specified
    """
    if name == 'relu':
        return torch.nn.ReLU()
    elif name == 'tanh':
        return torch.nn.Tanh()
    else:
        raise ValueError('Unsupported activation layer chosen.')