提交 bdbe9dcc authored 作者: Mohammad Pezeshki's avatar Mohammad Pezeshki

assertion for typo added.

上级 9c442dbf
...@@ -32,6 +32,7 @@ from theano.compile import Function, debugmode ...@@ -32,6 +32,7 @@ from theano.compile import Function, debugmode
from theano.compile.profilemode import ProfileMode from theano.compile.profilemode import ProfileMode
_logger = logging.getLogger("theano.printing") _logger = logging.getLogger("theano.printing")
VALID_ASSOC = set(['left', 'right', 'either'])
def debugprint(obj, depth=-1, print_type=False, def debugprint(obj, depth=-1, print_type=False,
...@@ -268,13 +269,13 @@ class PrinterState(gof.utils.scratchpad): ...@@ -268,13 +269,13 @@ class PrinterState(gof.utils.scratchpad):
props = {} props = {}
return PrinterState(self, **dict(props, **more_props)) return PrinterState(self, **dict(props, **more_props))
class OperatorPrinter: class OperatorPrinter:
def __init__(self, operator, precedence, assoc='left'): def __init__(self, operator, precedence, assoc='left'):
self.operator = operator self.operator = operator
self.precedence = precedence self.precedence = precedence
self.assoc = assoc self.assoc = assoc
assert self.assoc in VALID_ASSOC
def process(self, output, pstate): def process(self, output, pstate):
pprinter = pstate.pprinter pprinter = pstate.pprinter
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论