import torch


def unsqueeze(x: torch.Tensor, factor: int = 2) -> torch.Tensor:
    """
    Args:
        x: Tensor
            input tensor [batch, length, features]
        factor: int
            unsqueeze factor (default 2)
    Returns: Tensor
        squeezed tensor [batch, length * 2, features // 2]
    """
    assert factor >= 1
    if factor == 1:
        return x
    batch, length, features = x.size()
    assert features % factor == 0
    # [batch, length * factor, features // factor]
    x = x.view(batch, length * factor, features // factor)
    return x