提交 7250cdfe authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #2429 from mohammadpz/Composite_pretty_print

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