Exemple #1
0
 def make_node(self, x):
     x = T.as_tensor_variable(x)
     out = x.type()
     return Apply(self, [x], [out])
Exemple #2
0
 def make_node(self, x):
     x = as_tensor_variable(x)
     assert x.ndim == 2
     w = theano.tensor.vector(dtype=x.dtype)
     v = theano.tensor.matrix(dtype=x.dtype)
     return Apply(self, [x], [w, v])
Exemple #3
0
 def make_node(self, x):
     x = as_tensor_variable(x)
     assert x.ndim == 2
     return Apply(self, [x], [x.type()])
Exemple #4
0
 def make_node(self, x):
     x = tensor.as_tensor_variable(x)
     return Apply(self, [x], [x.type()])
Exemple #5
0
 def make_node(self, _x):
     x = as_tensor_variable(_x)
     if x.type.ndim != 1:
         raise TypeError('AllocDiag only works on vectors', _x)
     return Apply(self, [x], [theano.tensor.matrix(dtype=x.type.dtype)])
 def make_node(self, imgs):
     ffts_type = CudaNdarrayType((False, False, False, False))
     ffts = ffts_type()
     return Apply(self, [imgs], [ffts])
Exemple #7
0
 def make_node(self, xin):
     xout = xin.type.make_variable()
     return Apply(op=self, inputs=[xin], outputs=[xout])
Exemple #8
0
 def make_node(self, a, b):
     a = as_tensor_variable(a)
     b = as_tensor_variable(b)
     out_dtype = theano.scalar.upcast(a.dtype, b.dtype)
     x = theano.tensor.matrix(dtype=out_dtype)
     return Apply(self, [a, b], [x])
Exemple #9
0
 def make_node(self, x, toAppend):
     assert isinstance(x.type, TypedListType)
     assert x.type == toAppend.type
     return Apply(self, [x, toAppend], [x.type()])
Exemple #10
0
 def make_node(self, _x):
     x = as_tensor_variable(_x)
     if x.type.ndim != 2:
         raise TypeError('ExtractDiag only works on matrices', _x)
     return Apply(self, [x], [tensor.vector(dtype=x.type.dtype)])
Exemple #11
0
 def make_node(self, a):
     a = as_tensor_variable(a)
     out = a.type()
     return Apply(self, [a], [out])
Exemple #12
0
 def make_node(self, x):
     x = T.as_tensor_variable(x)
     if x.type.ndim != 4:
         raise TypeError('U2IElemwiseSum inputs should be 4-dim tensor')
     return Apply(self, [x], [x.type()])
Exemple #13
0
 def make_node(self, x):
     x = T.as_tensor_variable(x)
     if x.type.ndim != 4:
         raise TypeError('Input should be a 4-dim variable.')
     return Apply(self, [x], [x.type()])
Exemple #14
0
 def make_node(self, x, gz):
     out = x.type()
     return Apply(self, [x, gz], [out])
Exemple #15
0
 def make_node(self, x):
     x = T.as_tensor_variable(x)
     o = T.scalar(dtype=x.dtype)
     return Apply(self, [x], [o])
Exemple #16
0
 def make_node(self, x, toRemove):
     assert isinstance(x.type, TypedListType)
     assert x.ttype == toRemove.type
     return Apply(self, [x, toRemove], [x.type()])
 def make_node(self, a, b):
     c_type = CudaNdarrayType((False,))
     c = c_type()
     return Apply(self, [a, b], [c])
Exemple #18
0
 def make_node(self, x):
     assert isinstance(x.type, TypedListType)
     return Apply(self, [x], [x.type()])
 def make_node(self, in1, in2):
     out = CudaNdarrayType((False, False, False, False))
     return Apply(self, [in1, in2], [out()])
Exemple #20
0
 def make_node(self, x, elem):
     assert isinstance(x.type, TypedListType)
     assert x.ttype == elem.type
     return Apply(self, [x, elem], [T.scalar()])
 def make_node(self, x, i0, i1, amt):
     _i0 = tensor.as_tensor_variable(i0)
     _i1 = tensor.as_tensor_variable(i1)
     return Apply(self, [x, _i0, _i1, amt], [x.type()])
Exemple #22
0
 def make_node(self, x):
     assert isinstance(x.type, TypedListType)
     return Apply(self, [x], [T.scalar(dtype='int64')])
 def make_node(self, input):
     input = scalar.as_scalar(input)
     output = input.type()
     return Apply(self, [input], [output])
Exemple #24
0
 def make_node(self, *inputs):
     # Checking if arguments are of the right type is done in the scan
     # function
     out_types = [out.type() for out in self.outputs]
     return Apply(self, inputs, out_types)
Exemple #25
0
 def make_node(self, x):
     x = as_tensor_variable(x)
     assert x.ndim == 2
     o = theano.tensor.scalar(dtype=x.dtype)
     return Apply(self, [x], [o])
Exemple #26
0
 def make_node(self, c1, t1, c2, t2, c3, t3, f3):
     assert t1.type == f3.type
     assert t2.type == t3.type
     assert t3.type == f3.type
     return Apply(self, [c1, t1, c2, t2, c3, t3, f3], [t1.type()])
Exemple #27
0
 def make_node(self, x):
     x = as_tensor_variable(x)
     assert x.ndim == 2, "The input of qr function should be a matrix."
     q = theano.tensor.matrix(dtype=x.dtype)
     return Apply(self, [x], [q])
Exemple #28
0
 def make_node(self, x):
     return Apply(self, [x], [x.type()])
Exemple #29
0
 def make_node(self, x):
     assert imported_scipy, (
         "Scipy not available. Scipy is needed for the Cholesky op")
     x = as_tensor_variable(x)
     assert x.ndim == 2
     return Apply(self, [x], [x.type()])
 def make_node(self, *inputs):
     alpha = as_tensor_variable(inputs[0])
     xt = as_tensor_variable(inputs[1])
     xf = as_tensor_variable(inputs[2])
     ll = as_tensor_variable(.1)
     return Apply(self, [alpha, xt, xf], [ll.type()])