import torch


def load_feature(path):
    """
    Load features from path or IO.
    Args:
        path (io.BytesIO or string): File path or io.
    """
    if type(path) is str:
        with open(path, 'rb') as f:
            data = torch.load(f)
    else:
        data = torch.load(path)
    return data