| 551 | return {} |
| 552 | |
| 553 | def pprint(self, ofile, lineno=None, indent=0, memo=None): |
| 554 | if lineno is None: |
| 555 | lineno = [0] |
| 556 | if memo is None: |
| 557 | memo = {} |
| 558 | if self in memo: |
| 559 | print(lineno[0], " " * indent + memo[self], file=ofile) |
| 560 | else: |
| 561 | # TODO: set up a registry for this |
| 562 | if isinstance(self._obj, np.ndarray): |
| 563 | msg = "Literal{{np.ndarray,shape={},min={:f},max={:f}}}".format( |
| 564 | self._obj.shape, |
| 565 | self._obj.min(), |
| 566 | self._obj.max(), |
| 567 | ) |
| 568 | else: |
| 569 | msg = "Literal{%s}" % str(self._obj) |
| 570 | memo[self] = "%s [line:%i]" % (msg, lineno[0]) |
| 571 | print(lineno[0], " " * indent + msg, file=ofile) |
| 572 | lineno[0] += 1 |
| 573 | |
| 574 | def replace_input(self, old_node, new_node): |
| 575 | return [] |