import torch


def uniform_normalize(t: torch.Tensor):
    """
    :param t:
    :return: normalized tensor
    >>> a = torch.rand(5)
    tensor([0.3357, 0.9217, 0.0937, 0.1567, 0.9447])
    >>> uniform_normalize(a)
    tensor([0.2843, 0.9730, 0.0000, 0.0740, 1.0000])
    """
    t -= t.min(-1, keepdim=True)[0]
    t /= t.max(-1, keepdim=True)[0]
    return t