コード例 #1
0
ファイル: gprint.py プロジェクト: jangocheng/myia
 def __hrepr__(self, H, hrepr):
     if len(self.inputs) == 2 and \
             isinstance(self.inputs[0], Constant) and \
             self.inputs[0].value is primops.return_:
         return hrepr.hrepr_nowrap(self.inputs[1])['node-return']
     else:
         return super(Apply, self).__hrepr__(H, hrepr)
コード例 #2
0
ファイル: gprint.py プロジェクト: tor4z/myia
 def __hrepr__(self, H, hrepr):
     if (len(self.inputs) == 2 and isinstance(self.inputs[0], Constant)
             and self.inputs[0].value is primops.return_):
         if hasattr(hrepr, "hrepr_nowrap"):
             return hrepr.hrepr_nowrap(self.inputs[1])["node-return"]
         else:
             return hrepr(self.inputs[1])["node-return"]
     else:
         return super(Apply, self).__hrepr__(H, hrepr)