def test_sum_grad_001(self): v = Tensor(np.array([[1, 2, 3], [4, 5, 6]]), autograd=True) u = v.sum(0) u.backward(Tensor(np.array([1, 1, 1]))) print('grad: {0};'.format(v.to_string()))
def test_sum_001(self): v = Tensor(np.array([[1, 2, 3], [4, 5, 6]])) print(v.sum(0)) print(v.sum(1))