提交 297b138f authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Merge pull request #115 from nouiz/fix_vm

Fix vm
...@@ -319,7 +319,7 @@ class Stack(VM): ...@@ -319,7 +319,7 @@ class Stack(VM):
s=o[0].size s=o[0].size
dtype = str(o[0].dtype) dtype = str(o[0].dtype)
dtype2 = dtype[-3:] dtype2 = dtype[-3:]
s *= memory_size_map[dtype2] # KeyError here: couldn't determine the dtype memory size s *= self.memory_size_map[dtype2] # KeyError here: couldn't determine the dtype memory size
size.append(s) size.append(s)
self.outputs_size[current_apply] = size self.outputs_size[current_apply] = size
except Exception: except Exception:
...@@ -370,7 +370,7 @@ class Stack(VM): ...@@ -370,7 +370,7 @@ class Stack(VM):
s=o[0].size s=o[0].size
dtype = str(o[0].dtype) dtype = str(o[0].dtype)
dtype2 = dtype[-2:] dtype2 = dtype[-2:]
s *= memory_size_map[dtype2] # KeyError here: couldn't determine the dtype memory size s *= self.memory_size_map[dtype2] # KeyError here: couldn't determine the dtype memory size
size.append(s) size.append(s)
self.outputs_size[current_apply] = size self.outputs_size[current_apply] = size
if self.allow_gc: if self.allow_gc:
...@@ -442,7 +442,7 @@ class VM_Linker(link.LocalLinker): ...@@ -442,7 +442,7 @@ class VM_Linker(link.LocalLinker):
pre_call_clear = [storage_map[v] for v in self.no_recycling] pre_call_clear = [storage_map[v] for v in self.no_recycling]
if self.callback is not None: if self.callback is not None:
if use_cloop: if self.use_cloop:
logger.warn('CLoop does not support callback, using Stack VM.') logger.warn('CLoop does not support callback, using Stack VM.')
vm = Stack( vm = Stack(
nodes, thunks, pre_call_clear, nodes, thunks, pre_call_clear,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论