import torch


def vec_to_skew_symmetric(v):
    """Creates skew-symmetric matrix"""
    zero = torch.zeros_like(v[:, 0])
    M = torch.stack([
        zero, -v[:, 2], v[:, 1],
        v[:, 2], zero, -v[:, 0],
        -v[:, 1], v[:, 0], zero,
    ], dim=1)
    return M.reshape(-1, 3, 3)