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

raise an error when we try to create an SparseType object and scipy is not available.

上级 1ecbce71
...@@ -49,6 +49,9 @@ class SparseType(gof.Type): ...@@ -49,6 +49,9 @@ class SparseType(gof.Type):
@param format: The sparse storage strategy. @param format: The sparse storage strategy.
@return An empty SparseVariable instance. @return An empty SparseVariable instance.
""" """
if not imported_scipy:
raise Exception("You can't make SparseType object as SciPy"
" is not available.")
dtype = str(dtype) dtype = str(dtype)
if dtype in self.dtype_set: if dtype in self.dtype_set:
self.dtype = dtype self.dtype = dtype
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论