提交 05fc3574 authored 作者: James Bergstra's avatar James Bergstra

added info() to tag objects to print them nicely.

上级 47b077d6
...@@ -35,7 +35,13 @@ class scratchpad: ...@@ -35,7 +35,13 @@ class scratchpad:
self.__dict__.update(other.__dict__) self.__dict__.update(other.__dict__)
return self return self
def __str__(self): def __str__(self):
return "scratch" + str(self.__dict__) return "scratchpad" + str(self.__dict__)
def __repr__(self):
return "scratchpad" + str(self.__dict__)
def info(self):
print "<theano.gof.utils.scratchpad instance at %i>"%id(self)
for k,v in self.__dict__.items():
print " %s: %s" % (k,v)
class D: class D:
def __init__(self, **d): def __init__(self, **d):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论