提交 b33bc18e authored 作者: Dustin Webb's avatar Dustin Webb

Correct the way I was calling the __init__ functions on the parent classes of…

Correct the way I was calling the __init__ functions on the parent classes of CGemv and updated associated tests to always use the fix for issue 1569.
上级 c19b441e
...@@ -574,9 +574,8 @@ def gemv_c_code(aa, xx, yy, zz, alpha, beta, destructive, fail, force_init_beta= ...@@ -574,9 +574,8 @@ def gemv_c_code(aa, xx, yy, zz, alpha, beta, destructive, fail, force_init_beta=
class CGemv(BaseBLAS, Gemv): class CGemv(BaseBLAS, Gemv):
def __init__(self, force_init_beta=False, **kwargs): def __init__(self, inplace, force_init_beta=False):
super(BaseBLAS, self).__init__(**kwargs) super(CGemv, self).__init__(inplace)
super(Gemv, self).__init__()
self.force_init_beta = force_init_beta self.force_init_beta = force_init_beta
......
...@@ -137,7 +137,10 @@ class TestCGemv(TestCase, TestOptimizationMixin): ...@@ -137,7 +137,10 @@ class TestCGemv(TestCase, TestOptimizationMixin):
# Assert that the dot was optimized somehow # Assert that the dot was optimized somehow
self.assertFunctionContains0(f, tensor.dot) self.assertFunctionContains0(f, tensor.dot)
self.assertFunctionContains1(f, CGemv(True)) self.assertFunctionContains1(
f,
CGemv(inplace=True, force_init_beta=True)
)
# Assert they produce the same output # Assert they produce the same output
assert numpy.allclose(f(self.xval, self.Aval), assert numpy.allclose(f(self.xval, self.Aval),
...@@ -155,7 +158,10 @@ class TestCGemv(TestCase, TestOptimizationMixin): ...@@ -155,7 +158,10 @@ class TestCGemv(TestCase, TestOptimizationMixin):
# Assert that the dot was optimized somehow # Assert that the dot was optimized somehow
self.assertFunctionContains0(f, tensor.dot) self.assertFunctionContains0(f, tensor.dot)
self.assertFunctionContains1(f, CGemv(True)) self.assertFunctionContains1(
f,
CGemv(inplace=True, force_init_beta=True)
)
# Assert they produce the same output # Assert they produce the same output
assert numpy.allclose(f(self.Aval, self.yval), assert numpy.allclose(f(self.Aval, self.yval),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论