提交 2011fb6f authored 作者: Frederic's avatar Frederic

more rebust itemsize check.

fix problem that complex64 wasn't supported.
上级 d2b2e4eb
......@@ -150,9 +150,6 @@ class ProfileStats(object):
optimizer_profile = None
# None or tuple (the optimizer, the profile it returned)
memory_size_map = {"nt8": 1, "t16": 2, "t32": 4,
"t64": 8, "128": 16}
# param is called flag_time_thunks because most other attributes with time
# in the name are times *of* something, rather than configuration flags.
def __init__(self, atexit_print=True, flag_time_thunks=None, **kwargs):
......@@ -606,7 +603,7 @@ class ProfileStats(object):
sh = self.variable_shape[out]
v = numpy.prod(sh)
dtype = str(out.dtype)
v *= self.memory_size_map[dtype[-3:]]
v *= numpy.dtype(dtype).itemsize
var_mem[out] = v
fct_memory[node.fgraph][node].append(v)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论