 
     thrust::copy(values.begin(), values.end(), Xt.begin());
 
-    *X[t] = Xt;
+    std::stringstream ss;
+    ss << "X" << t;
+    g[ss.str()] = Xt;
+
   }
 
-  for (int t = 0; t < num_outputs; ++t) {
+  for (int t = 0; t <= num_outputs; ++t) {
     Tensor Yt({batch_size, output_size});
 
     std::vector<float> classes(batch_size * output_size, 0.0);


    thrust::copy(classes.begin(), classes.end(), Yt.begin());

    *Y[t] = Yt;
  }

  g.forward(batch_size);
  g.backward();

  std::cerr << graph.val().Debug() << std::endl;

  std::cerr << X[0]->val().Debug() << std::endl;
  std::cerr << Y[0]->val().Debug() << std::endl;

  std::cerr << Whh.grad().Debug() << std::endl;
  std::cerr << bh.grad().Debug() << std::endl;
  std::cerr << Why.grad().Debug() << std::endl;
  std::cerr << by.grad().Debug() << std::endl;
  std::cerr << Wxh.grad().Debug() << std::endl;
  std::cerr << h0.grad().Debug() << std::endl;

  return 0;
}



int main(int argc, char** argv) {

  ExpressionGraph g = build_graph(0);

  // For the stop symbol.
  for (int t = 0; t <= num_inputs; ++t) {
