def test_batchnorm(self):
        for _ in range(self.test_epoch):
            # tensor
            x0 = np.random.randn(10, 64)
            x1 = np.random.randn(10, 1)  # gamma
            x2 = np.random.randn(10, 1)  # beta
            next_error = np.random.randn(10, 64) / 64.
            f_str = '((x0 - be.mean(x0, axis=1)) / be.sqrt(be.var(x0, axis=1) + 1e-6)) * x1 + x2'
            # gradient
            self._assert_grad_equal(f_str, [x0, x1, x2], rtol=1e-1, atol=1e-2,
                                    next_error=next_error)
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/tests/test_autodiff_extra.py/TestAutodiff.test_batchnorm/original