예제 #1
0
 def make_node(self, x, y):
     if isinstance(x, (int, float)):
         x = gof.Constant(double, x)
     if isinstance(y, (int, float)):
         y = gof.Constant(double, y)
     if x.type != double or y.type != double:
         raise TypeError('%s only works on doubles' % self.name)
     return gof.Apply(self, [x, y], [double()])
예제 #2
0
    def make_node(self, x, y):
        if isinstance(x, (int, float)):
            x = gof.Constant(double, x)
        if isinstance(y, (int, float)):
            y = gof.Constant(double, y)
        if x.type != double or y.type != double:
            raise TypeError("Only works for doubles silly")

        return gof.Apply(self, [x, y], [double(), double()])