import torch
from typing import List


def named_tensor_split(tensor: torch.Tensor, split_size: int, dim: str) \
        -> List[torch.Tensor]:
    """
    As working in torch.split but added list()
    Args:
        tensor (): the tensor to split
        split_size (): the size of the splits
        dim (): the dimension of each of the splits

    Returns:
        list of splits
    """
    dim_index = tensor.names.index(dim)
    return list(tensor.split(split_size, dim=dim_index))