@@ -0,0 +1,920 @@
+from unittest import TestCase%0Aimport numpy as np%0Afrom chainer import cuda, Optimizer%0Afrom chainer.optimizer import _sqnorm%0A%0Acuda.init()%0A%0Aclass TestOptimizerUtility(TestCase):%0A    def setUp(self):%0A        # x is an arithmetic progression of length 6%0A        # whose common difference is 0.5%0A        self.x = np.linspace(-1.0, 1.5, num=6).astype(np.float32).reshape(2, 3)%0A        self.a = np.array(2.0)%0A%0A    def test_sqnorm_cpu(self):%0A        # %5CSum_%7Bn=0%7D%5E%7B5%7D (-1.0+0.5n)**2 = 4.75%0A        self.assertAlmostEqual(_sqnorm(self.x), 4.75)%0A%0A    def test_sqnorm_scalar_cpu(self):%0A        self.assertAlmostEqual(_sqnorm(self.a), 4)%0A%0A    def test_sqnorm_gpu(self):%0A        x = cuda.to_gpu(self.x)%0A        self.assertAlmostEqual(_sqnorm(x), 4.75)%0A%0A    def test_sqnorm_scalar_gpu(self):%0A        a = cuda.to_gpu(self.a)%0A        self.assertAlmostEqual(_sqnorm(a), 4)%0A%0Aclass TestOptimizer(TestCase):%0A    def setUp(self):%0A        pass%0A

Add unittest for utility functions of optimizer