Beispiel #1
0
    def test_eq(self):
        self.assert_(CGer(True) == CGer(True))
        self.assert_(CGer(False) == CGer(False))
        self.assert_(CGer(False) != CGer(True))

        self.assert_(CGer(True) != ScipyGer(True))
        self.assert_(CGer(False) != ScipyGer(False))
        self.assert_(CGer(True) != Ger(True))
        self.assert_(CGer(False) != Ger(False))

        # assert that eq works for non-CGer instances
        self.assert_(CGer(False) is not None)
        self.assert_(CGer(True) is not None)
Beispiel #2
0
    def test_eq(self):
        assert CGer(True) == CGer(True)
        assert CGer(False) == CGer(False)
        assert CGer(False) != CGer(True)

        assert CGer(True) != ScipyGer(True)
        assert CGer(False) != ScipyGer(False)
        assert CGer(True) != Ger(True)
        assert CGer(False) != Ger(False)

        # assert that eq works for non-CGer instances
        assert CGer(False) is not None
        assert CGer(True) is not None
Beispiel #3
0
 def test_A_plus_scaled_outer(self):
     f = self.function([self.A, self.x, self.y],
                       self.A + 0.1 * tensor.outer(self.x, self.y))
     self.assertFunctionContains(f, ScipyGer(destructive=False))
     self.run_f(f)  # DebugMode tests correctness
Beispiel #4
0
 def test_outer(self):
     f = self.function([self.x, self.y], tensor.outer(self.x, self.y))
     self.assertFunctionContains(f, ScipyGer(destructive=True))