def test_forward(self):
        random = np.random.RandomState(1)
        X = random.rand(self.N, self.T, self.D)
        tolerance = 1e-4
        Y2 = self.realForward(X)
        Y = self.model.forward(X)
        Y2 = Y2.reshape(Y2.size)
        Y = Y.reshape(Y.size)
        for i in range(Y.size):
            self.assertTrue((Y[i] == 0 and Y2[i] == 0) or (np.abs(Y[i] / Y2[i] - 1) < tolerance))
dataset/ETHPy150Open renmengye/imageqa-public/src/nn/recurrent_tests.py/Recurrent_Tests.test_forward/original