提交 12d97411 authored 作者: David Warde-Farley's avatar David Warde-Farley 提交者: Arnaud Bergeron

Use add_metaclass from six.

上级 fb4a7b3c
...@@ -4,7 +4,7 @@ import theano ...@@ -4,7 +4,7 @@ import theano
import theano.tensor as T import theano.tensor as T
import collections import collections
from theano.compat.six import string_types from theano.compat.six import string_types, add_metaclass
#import klass #import klass
...@@ -44,10 +44,9 @@ class InitGraph(type): ...@@ -44,10 +44,9 @@ class InitGraph(type):
setattr(cls, key, val) setattr(cls, key, val)
# installs class attributes from build_graph after declaration
@add_metaclass(InitGraph)
class SymbolicModule(object): class SymbolicModule(object):
# installs class attributes from build_graph after declaration
__metaclass__ = InitGraph
# if we call this function, it will return a new SymbolicModule # if we call this function, it will return a new SymbolicModule
def __new__(self, **kwargs): def __new__(self, **kwargs):
class SymMod(SymbolicModule): class SymMod(SymbolicModule):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论