提交 ee6a461d authored 作者: abalkin's avatar abalkin

Reuse theano.compat.cmp. (Suggested by @lamblin.)

上级 78ccc486
...@@ -5,14 +5,9 @@ from theano.gof.graph import Variable, Apply, Constant ...@@ -5,14 +5,9 @@ from theano.gof.graph import Variable, Apply, Constant
from theano.gof.type import Type from theano.gof.type import Type
from theano.gof.op import Op from theano.gof.op import Op
from theano.gof import fg from theano.gof import fg
from theano.gof import toolbox
from theano.gof.link import * from theano.gof.link import *
try: from theano.compat import cmp
cmp
except NameError:
def cmp(a, b):
return (a > b) - (a < b)
def as_variable(x): def as_variable(x):
assert isinstance(x, Variable) assert isinstance(x, Variable)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论