node word = xp.array([node['node']], np.int32) loss = 0 x = chainer.Variable(word) v = model.leaf(x) else: # internal node left_node, right_node = node['node'] left_loss, left = traverse(model, left_node) right_loss, right = traverse(model, right_node) v = model.node(left, right) loss = left_loss + right_loss 48