def append_dims(x, num_dims):
    """Appends extra dimensions to the input tensor `x`."""
    if num_dims <= 0:
        return x
    return x.view(*x.shape, *((1,) * num_dims))
Appends extra dimensions to the input tensor `x`.
clearvoice/clearvoice/models/mossformer2_ss/mossformer2_block.py