import numpy as np import chainer as ch x_data = np.array([5], dtype=np.float32) x = ch.Variable(x_data) y = x ** 2 - 2 * x + 1 print(y.data)