import torch


def mu_inverse(y):
    """ Inverse operation of mu-law transform for 16-bit integers. """
    assert y.min() >= -1 and y.max() <= 1
    return torch.sign(y) / 32768. * ((1 + 32768.) ** torch.abs(y) - 1)