提交 7d6ad913 authored 作者: amrithasuresh's avatar amrithasuresh

Updated numpy as np

上级 c048e255
...@@ -15,7 +15,7 @@ from copy import deepcopy ...@@ -15,7 +15,7 @@ from copy import deepcopy
from theano.compat import izip from theano.compat import izip
import logging import logging
import numpy import numpy as np
import theano.tensor import theano.tensor
from theano.tensor import TensorType from theano.tensor import TensorType
...@@ -259,7 +259,7 @@ class IfElse(Op): ...@@ -259,7 +259,7 @@ class IfElse(Op):
if self.as_view: if self.as_view:
storage_map[out][0] = val storage_map[out][0] = val
# Work around broken numpy deepcopy # Work around broken numpy deepcopy
elif type(val) in (numpy.ndarray, numpy.memmap): elif type(val) in (np.ndarray, np.memmap):
storage_map[out][0] = val.copy() storage_map[out][0] = val.copy()
else: else:
storage_map[out][0] = deepcopy(val) storage_map[out][0] = deepcopy(val)
...@@ -276,7 +276,7 @@ class IfElse(Op): ...@@ -276,7 +276,7 @@ class IfElse(Op):
# improves # improves
# Work around broken numpy deepcopy # Work around broken numpy deepcopy
val = storage_map[f][0] val = storage_map[f][0]
if type(val) in (numpy.ndarray, numpy.memmap): if type(val) in (np.ndarray, np.memmap):
storage_map[out][0] = val.copy() storage_map[out][0] = val.copy()
else: else:
storage_map[out][0] = deepcopy(val) storage_map[out][0] = deepcopy(val)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论