Exemplo n.º 1
0
 def make_node(self, input, axis=-1):
     input = theano.tensor.as_tensor_variable(input)
     if axis is None:
         axis = theano.Constant(theano.gof.generic, None)
         # axis=None flattens the array before sorting
         out_type = tensor(dtype=input.dtype, broadcastable=[False])
     else:
         axis = theano.tensor.as_tensor_variable(axis)
         out_type = input.type()
     return theano.Apply(self, [input, axis], [out_type])
Exemplo n.º 2
0
 def make_node(self, input, axis=-1):
     input = theano.tensor.as_tensor_variable(input)
     if axis is None:
         axis = theano.Constant(theano.gof.generic, None)
         bcast = [False]
     else:
         axis = theano.tensor.as_tensor_variable(axis)
         bcast = input.type.broadcastable
     return theano.Apply(self, [input, axis],
         [theano.tensor.TensorType(dtype="int64", broadcastable=bcast)()])