提交 d47e2c12 authored 作者: Frederic's avatar Frederic

Test sparse.Dot with int16 or complex64 in input and fix this case.

It was returning an numpy.matrix instead of an numpy.array.
上级 f2608775
...@@ -1505,7 +1505,7 @@ class Dot(gof.op.Op): ...@@ -1505,7 +1505,7 @@ class Dot(gof.op.Op):
rval = x * y rval = x * y
if x_is_sparse and y_is_sparse: if x_is_sparse and y_is_sparse:
rval = rval.todense() rval = rval.toarray()
out[0] = rval out[0] = rval
......
...@@ -560,6 +560,8 @@ class DotTests(unittest.TestCase): ...@@ -560,6 +560,8 @@ class DotTests(unittest.TestCase):
('float32', 'float64'), ('float32', 'float64'),
('float64', 'float32'), ('float64', 'float32'),
('float64', 'float64'), ('float64', 'float64'),
('float32', 'int16'),
('float32', 'complex64'),
]: ]:
for x_f, y_f in [('csc','csc'), for x_f, y_f in [('csc','csc'),
('csc','csr'), ('csc','csr'),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论