Exemplo n.º 1
0
 def __init__(self, backend):
     Backend.__init__(self, 'Symbolic Field Backend')
     self.backend = backend
     for fname in dir(self):
         if fname not in ('__init__', 'is_tensor', 'is_applicable', 'symbolic_call') and not fname.startswith('__'):
             function = getattr(self, fname)
             if callable(function):
                 def context(fname=fname):
                     def proxy(*args, **kwargs):
                         return self.symbolic_call(fname, args, kwargs)
                     return proxy
                 setattr(self, fname, context())
Exemplo n.º 2
0
 def __init__(self, backend, target_content_type=struct.VALID):
     Backend.__init__(self, 'StructBroadcast')
     self.backend = backend
     self.target_content_type = target_content_type
     for fname in dir(self):
         if fname not in ('__init__', 'is_applicable', 'broadcast_function') and not fname.startswith('__'):
             function = getattr(self, fname)
             if callable(function):
                 def context(fname=fname):
                     def proxy(*args, **kwargs):
                         return self.broadcast_function(self.backend, fname, args, kwargs)
                     return proxy
                 setattr(self, fname, context())
Exemplo n.º 3
0
 def __init__(self):
     Backend.__init__(self, "TensorFlow")
Exemplo n.º 4
0
 def __init__(self):
     Backend.__init__(self, 'PyTorch')