import torch


def neginf(dtype):
    """
    Return a representable finite 
    number near -inf for a dtype.
    """
    if dtype is torch.float16:
        return -65504
    else:
        return -1e20