def remove_last_dim(arr):
    """
    Reshapes the given array to remove the last dimension (this makes
    the assumption that the last dimension is of shape 1).
    """
    return arr.reshape(arr.shape[0], arr.shape[1])