from typing import Tuple
import torch


def load_tensor_from_file(filepath: str) -> Tuple[torch.Tensor, str]:
    """
    Load torch.Tensor and the name from file
    """
    frame = []
    with open(filepath, "r", encoding='utf-8') as f:
        for line in f.readlines():
            frame.append(float(line))

    name = filepath.split("/")[-1].rsplit(".", 1)[0]
    return torch.tensor(frame), name