提交 5b53e627 authored 作者: James Bergstra's avatar James Bergstra

ENH: vm.Stack uses deque for stack instead of list

上级 e1c07d5b
""" """
VMs that run Theano graph computations. VMs that run Theano graph computations.
""" """
import collections
import logging import logging
import sys import sys
import time import time
...@@ -254,7 +255,7 @@ class Stack(VM): ...@@ -254,7 +255,7 @@ class Stack(VM):
compute_map[k][0] = (k.owner is None) compute_map[k][0] = (k.owner is None)
# apply_stack contains nodes # apply_stack contains nodes
apply_stack = list(self.base_apply_stack) apply_stack = collections.deque(self.base_apply_stack)
last_apply_stack_len = -1 last_apply_stack_len = -1
ls = [] ls = []
while apply_stack: while apply_stack:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论