コード例 #1
0
ファイル: extra_ops.py プロジェクト: Abhikos/Theano
 def make_node(self, x, v, sorter=None):
     x = basic.as_tensor(x, ndim=1)
     v = basic.as_tensor(v)
     out_type = v.type.clone(dtype='int64')
     if sorter is None:
         return theano.Apply(self, [x, v], [out_type()])
     else:
         sorter = basic.as_tensor(sorter, ndim=1)
         if sorter.type not in basic.int_vector_types:
             raise TypeError('sorter must be an integer vector',
                             sorter.type)
         return theano.Apply(self, [x, v, sorter], [out_type()])
コード例 #2
0
 def make_node(self, x, v, sorter=None):
     x = basic.as_tensor(x, ndim=1)
     v = basic.as_tensor(v)
     out_type = v.type.clone(dtype='int64')
     if sorter is None:
         return theano.Apply(self, [x, v], [out_type()])
     else:
         sorter = basic.as_tensor(sorter, ndim=1)
         if sorter.type not in basic.int_vector_types:
             raise TypeError('sorter must be an integer vector',
                             sorter.type)
         return theano.Apply(self, [x, v, sorter], [out_type()])
コード例 #3
0
ファイル: extra_ops.py プロジェクト: Theano/Theano
 def make_node(self, x, v, sorter=None):
     x = basic.as_tensor(x, ndim=1)
     v = basic.as_tensor(v)
     out_type = v.type.clone(dtype="int64")
     if sorter is None:
         return theano.Apply(self, [x, v], [out_type()])
     else:
         sorter = basic.as_tensor(sorter, ndim=1)
         if theano.configdefaults.python_int_bitwidth() == 32 and sorter.dtype == "int64":
             raise TypeError("numpy.searchsorted with Python 32bit do not support a" " sorter of int64.")
         if sorter.type not in basic.int_vector_types:
             raise TypeError("sorter must be an integer vector", sorter.type)
         return theano.Apply(self, [x, v, sorter], [out_type()])
コード例 #4
0
 def make_node(self, x, v, sorter=None):
     x = basic.as_tensor(x, ndim=1)
     v = basic.as_tensor(v)
     out_type = v.type.clone(dtype="int64")
     if sorter is None:
         return theano.Apply(self, [x, v], [out_type()])
     else:
         sorter = basic.as_tensor(sorter, ndim=1)
         if PYTHON_INT_BITWIDTH == 32 and sorter.dtype == "int64":
             raise TypeError(
                 "numpy.searchsorted with Python 32bit do not support a"
                 " sorter of int64.")
         if sorter.type not in basic.int_vector_types:
             raise TypeError("sorter must be an integer vector",
                             sorter.type)
         return theano.Apply(self, [x, v, sorter], [out_type()])
コード例 #5
0
 def make_node(self, x, v, sorter=None):
     x = basic.as_tensor(x, ndim=1)
     v = basic.as_tensor(v)
     out_type = v.type.clone(dtype='int64')
     if sorter is None:
         return theano.Apply(self, [x, v], [out_type()])
     else:
         sorter = basic.as_tensor(sorter, ndim=1)
         if (theano.configdefaults.python_int_bitwidth() == 32 and
                 sorter.dtype == 'int64'):
             raise TypeError(
                 "numpy.searchsorted with Python 32bit do not support a"
                 " sorter of int64.")
         if sorter.type not in basic.int_vector_types:
             raise TypeError('sorter must be an integer vector',
                             sorter.type)
         return theano.Apply(self, [x, v, sorter], [out_type()])