def _read(self, x, F_xt, F_y, gamma): return tf.reshape(tf.batch_matmul(F_y, tf.batch_matmul( tf.reshape(x, [-1,self.height,self.width]), F_xt)), [-1,self.read_dim])*tf.reshape(gamma, [-1,1])