def METHOD_NAME(x, qz):
    """
    M-step computes summary statistics in numpy.
    """
    x = x.astype("float64")
    qz = qz.astype("float64")
    nz = qz.sum(axis=0)  # (num_clusters,)
    sum_x = (qz[:, :, None] * x[:, None, :]).sum(axis=0)
    sum_x2 = (
        qz[:, :, None, None] * (x[:, None, :, None] @ x[:, None, None, :])
    ).sum(axis=0)
    return nz, sum_x, sum_x2