@staticmethod
    def _pretty_print(node):
        operators = {'add': '+',
                     'sub': '-',
                     'mul': '*',
                     'div': '/',
                     'pow': '**'}
        s = ''
        if isinstance(node, Tensor):
            if node.name:
                s = node.name
            else:
                s = 'tensor-' + hex(id(node))
        elif isinstance(node, OpTreeNode):
            if node[2]:
                s += OpTreeNode._pretty_print(node[1]) + ' '
                if operators in node[0]['op']:
                    s += operators[node[0]['op']]
                else:
                    s += node[0]['op']
                s += ' ' + OpTreeNode._pretty_print(node[2])
            else:
                s = node[0]['op'] + ' ' + OpTreeNode._pretty_print(node[1])
            s = '(' + s + ')'
        else:
            s = str(node)  # TODO
            s = '(' + s + ')'
        return s
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/backend.py/OpTreeNode._pretty_print/swapped operands of `in`