def data_model(g_r, g_i, fg_r, fg_i, fg_comps, ant0_inds, ant1_inds):
    gr0 = tf.gather(g_r, ant0_inds)
    gr1 = tf.gather(g_r, ant1_inds)
    gi0 = tf.gather(g_i, ant0_inds)
    gi1 = tf.gather(g_i, ant1_inds)
    grgr = (gr0 * gr1)
    gigi = (gi0 * gi1)
    grgi = (gr0 * gi1)
    gigr = (gi0 * gr1)
    (vr, vi) = fg_model(fg_r, fg_i, fg_comps)
    model_r = (((grgr + gigi) * vr) + ((grgi - gigr) * vi))
    model_i = (((gigr - grgi) * vr) + ((grgr + gigi) * vi))
    return (model_r, model_i)
def data_model(g_r, g_i, fg_r, fg_i, fg_comps, ant0_inds, ant1_inds):
    gr0 = tf.gather(g_r, ant0_inds)
    gr1 = tf.gather(g_r, ant1_inds)
    gi0 = tf.gather(g_i, ant0_inds)
    gi1 = tf.gather(g_i, ant1_inds)
    grgr = (gr0 * gr1)
    gigi = (gi0 * gi1)
    grgi = (gr0 * gi1)
    gigr = (gi0 * gr1)
    (vr, vi) = fg_model(fg_r, fg_i, fg_comps)
    model_r = (((grgr + gigi) * vr) + ((grgi - gigr) * vi))
    model_i = (((gigr - grgi) * vr) + ((grgr + gigi) * vi))
    return (model_r, model_i)