Tensor forward(Tensor x) { Tensor out = x; for (var layer in layers) { out = layer.forward(out); } return out; }