for i in range(20):
 for d in range(4): # d is depth
   with tf.devices(“/gpu:%d” % d):
    input = x[i] if d is 0 lease m[d-1]
    m[d], c[d] = LSTMCell(input, mprev[d], cprev[d])
    mprev[d] = m[d]
    cprev[d] = c[d]
Advertisements