提交 ea0a1715 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

made Features use OrderedDicts

上级 6782253b
...@@ -518,7 +518,8 @@ def add_clear_storage(f, computed, storage_map): ...@@ -518,7 +518,8 @@ def add_clear_storage(f, computed, storage_map):
class WrapLinker(Linker): class WrapLinker(Linker):
""" WRITEME """
WRITEME
This class makes it easier to run several L{LocalLinker}s in parallel, and This class makes it easier to run several L{LocalLinker}s in parallel, and
offers some control over how each thunk is run. offers some control over how each thunk is run.
...@@ -643,10 +644,12 @@ class WrapLinker(Linker): ...@@ -643,10 +644,12 @@ class WrapLinker(Linker):
raise_with_op(node) raise_with_op(node)
f.thunk_groups = thunk_groups f.thunk_groups = thunk_groups
print 'WrapLinker make_thunk returning: ',id(f)
return f, inputs0, outputs0 return f, inputs0, outputs0
def WrapLinkerMany(linkers, wrappers): def WrapLinkerMany(linkers, wrappers):
""" Variant on WrapLinker that runs a series of wrapper functions instead of """
Variant on WrapLinker that runs a series of wrapper functions instead of
just one. just one.
""" """
def wrapper(*args): def wrapper(*args):
......
...@@ -2,10 +2,12 @@ import sys ...@@ -2,10 +2,12 @@ import sys
import time import time
from theano.gof.python25 import partial from theano.gof.python25 import partial
from theano.gof.python25 import OrderedDict
import graph import graph
class AlreadyThere(Exception): class AlreadyThere(Exception):
"""Raised by a Feature's on_attach callback method if the FunctionGraph """Raised by a Feature's on_attach callback method if the FunctionGraph
attempting to attach the feature already has a functionally identical attempting to attach the feature already has a functionally identical
...@@ -89,7 +91,7 @@ class Feature(object): ...@@ -89,7 +91,7 @@ class Feature(object):
If you raise an exception in this function, the state of the graph If you raise an exception in this function, the state of the graph
might be broken for all intents and purposes. might be broken for all intents and purposes.
""" """
return {} return OrderedDict()
class Bookkeeper(Feature): class Bookkeeper(Feature):
......
""" """
VMs that run Theano graph computations. VMs that run Theano graph computations.
A VM is not actually different from a Linker, we just decided A VM is not actually different from a Linker, we just decided
VM was a better name at some point VM was a better name at some point.
""" """
import link import link
import logging import logging
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论