'Sets up all components of the computation graph.'

def setup(self):

    (self.x, self.y) = self.get_xy_placeholders()
    with tf.variable_scope('core', reuse=None):
        (self.loss, self.gradient_ops) = self.train(self.x, self.y)
    with tf.variable_scope('core', reuse=True):
        self.y_preds = self.eval(self.x, self.y)
    (self.mem_keys, self.mem_vals, self.mem_age, self.recent_idx) = self.memory.get()
    self.mem_keys_reset = tf.placeholder(self.mem_keys.dtype, tf.identity(self.mem_keys).shape)
    self.mem_vals_reset = tf.placeholder(self.mem_vals.dtype, tf.identity(self.mem_vals).shape)
    self.mem_age_reset = tf.placeholder(self.mem_age.dtype, tf.identity(self.mem_age).shape)
    self.recent_idx_reset = tf.placeholder(self.recent_idx.dtype, tf.identity(self.recent_idx).shape)
    self.mem_reset_op = self.memory.set(self.mem_keys_reset, self.mem_vals_reset, self.mem_age_reset, None)
