提交 5847e110 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Make DebugMode keep memory layout when possible.

This will still convert a noncontiguous array to contiguous, but will not convert F to C. We can make it keep the noncontiguous layout but it's more involved and can take a *LOT* more of memory.
上级 18985e9b
...@@ -1026,7 +1026,7 @@ def _lessbroken_deepcopy(a): ...@@ -1026,7 +1026,7 @@ def _lessbroken_deepcopy(a):
# This logic is also in link.py # This logic is also in link.py
from theano.gof.type import _cdata_type from theano.gof.type import _cdata_type
if type(a) in (np.ndarray, np.memmap): if type(a) in (np.ndarray, np.memmap):
rval = a.copy() rval = a.copy(order='K')
elif type(a) is _cdata_type: elif type(a) is _cdata_type:
# This is not copyable (and should be used for constant data). # This is not copyable (and should be used for constant data).
rval = a rval = a
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论