import tensorflow as tf

    with tf.device('/gpu:0'):
        c = tf.matmul(a,b)
        c = tf.reshape(c, [-1])

    with tf.device('/gpu:1'):
        d = tf.matmul(b, a)
        flat_d = tf.reshape(d, [-1])

    combined = tf.multiply(c, flat_d)
print(sess.run(combined))

