def chkEqual(self, a, b):
        tolerance = 1e-1
        a = a.reshape(a.size)
        b = b.reshape(b.size)
        for i in range(a.size):
            if not ((a[i] == 0 and b[i] == 0) or
                (np.abs(a[i]) < 1e-8 and np.abs(b[i]) < 1e-8) or
                (np.abs(a[i] / b[i] - 1) < tolerance)):
                    print a[i], b[i], a[i]/b[i]
            self.assertTrue(
                (a[i] == 0 and b[i] == 0) or
                (np.abs(a[i]) < 1e-8 and np.abs(b[i]) < 1e-8) or
                (np.abs(a[i] / b[i] - 1) < tolerance))
dataset/ETHPy150Open renmengye/imageqa-public/src/nn/recurrent_tests.py/LSTM_Recurrent_Random_Tests.chkEqual/original