Esempio n. 1
0
 def test_A_plus_scaled_outer(self):
     skip_if_blas_ldflags_empty()
     f = self.function(
         [self.A, self.x, self.y], self.A + 0.1 * at.outer(self.x, self.y)
     )
     self.assertFunctionContains(f, CGer(destructive=False))
     self.run_f(f)  # DebugMode tests correctness
Esempio n. 2
0
 def test_int_fails(self):
     self.manual_setup_method("int32")
     f = self.function([self.x, self.y], aet.outer(self.x, self.y))
     self.assertFunctionContains0(f, CGer(destructive=True))
     self.assertFunctionContains0(f, CGer(destructive=False))
Esempio n. 3
0
 def test_optimization_pipeline_float(self):
     skip_if_blas_ldflags_empty()
     self.manual_setup_method("float32")
     f = self.function([self.x, self.y], aet.outer(self.x, self.y))
     self.assertFunctionContains(f, CGer(destructive=True))
     f(self.xval, self.yval)  # DebugMode tests correctness
Esempio n. 4
0
 def test_hash(self):
     assert hash(CGer(True)) == hash(CGer(True))
     assert hash(CGer(False)) == hash(CGer(False))
     assert hash(CGer(False)) != hash(CGer(True))
Esempio n. 5
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
Esempio n. 6
0
 def test_optimization_pipeline(self):
     skip_if_blas_ldflags_empty()
     f = self.function([self.x, self.y], at.outer(self.x, self.y))
     self.assertFunctionContains(f, CGer(destructive=True))
     f(self.xval, self.yval)  # DebugMode tests correctness