import torch


def cr_matrix_vector_product(m: torch.Tensor, x: torch.Tensor) -> torch.Tensor:
    """Returns the product of a complex matrix and a real vector.

    :param m: Matrix as ``(*, m, n, 2)`` tensor.
    :param x: Vector as ``(*, n)`` tensor.
    :return: Result as ``(*, m, 2)`` tensor.
    """
    xr = x.unsqueeze(-1)
    mr = m[..., 0]
    mi = m[..., 1]

    rr = torch.matmul(mr, xr)
    ir = torch.matmul(mi, xr)

    return torch.cat([rr, ir], dim=-1)