提交 ccdc071b authored 作者: James Bergstra's avatar James Bergstra

Added copy() of data in sparse.constant constructor

上级 25682947
...@@ -105,7 +105,7 @@ def constant(x): ...@@ -105,7 +105,7 @@ def constant(x):
raise TypeError("sparse.constant must be called on a scipy.sparse.spmatrix") raise TypeError("sparse.constant must be called on a scipy.sparse.spmatrix")
try: try:
return SparseConstant(SparseType(format = x.format, return SparseConstant(SparseType(format = x.format,
dtype = x.dtype), x) dtype = x.dtype), x.copy())
except TypeError: except TypeError:
raise TypeError("Could not convert %s to SparseType" % x, type(x)) raise TypeError("Could not convert %s to SparseType" % x, type(x))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论