#NEWLINE# def make_node( self , x , y , * inputs ) : #NEWLINE# #INDENT# x = theano . tensor . as_tensor_variable ( x ) #NEWLINE# y = theano . tensor . as_tensor_variable ( y ) #NEWLINE# op = self #NEWLINE# if ( ( not self . set_instead_of_inc ) and ( inplace_increment is None ) ) : #NEWLINE# #INDENT# legacy_conditions = False #NEWLINE# if ( ( x . ndim == 2 ) and ( y . ndim == 1 ) and ( len ( inputs ) == 2 ) ) : #NEWLINE# #INDENT# ind1 = theano . tensor . as_tensor_variable ( inputs [ 0 ] ) #NEWLINE# ind2 = theano . tensor . as_tensor_variable ( inputs [ 1 ] ) #NEWLINE# if ( ( ind1 . ndim == 1 ) and ( ind2 . ndim == 1 ) ) : #NEWLINE# #INDENT# if ( ind1 . owner and isinstance ( ind1 . owner . op , ARange ) ) : #NEWLINE# #INDENT# legacy_conditions = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( ind1 , Constant ) : #NEWLINE# #INDENT# val = ind1 . value #NEWLINE# if ( numpy . unique ( val ) . size == val . size ) : #NEWLINE# #INDENT# legacy_conditions = True #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ind2 . owner and isinstance ( ind2 . owner . op , ARange ) ) : #NEWLINE# #INDENT# legacy_conditions = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( ind2 , Constant ) : #NEWLINE# #INDENT# val = ind2 . value #NEWLINE# if ( numpy . unique ( val ) . size == val . size ) : #NEWLINE# #INDENT# legacy_conditions = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if legacy_conditions : #NEWLINE# #INDENT# op = copy ( self ) #NEWLINE# op . allow_legacy_perform = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise NotImplementedError ( 'Could not import inplace_increment, so some advanced indexing features are disabled. They will be available if you update NumPy to version 1.8 or later, or to the latest development version. You may need to clear the cache (theano-cache clear) afterwards.' ) #NEWLINE# #UNINDENT# #UNINDENT# new_inputs = [ ] #NEWLINE# for inp in inputs : #NEWLINE# #INDENT# if isinstance ( inp , ( list , tuple ) ) : #NEWLINE# #INDENT# inp = theano . tensor . as_tensor_variable ( inp ) #NEWLINE# #UNINDENT# new_inputs . append ( inp ) #NEWLINE# #UNINDENT# return gof . Apply ( op , ( ( x , y ) + tuple ( new_inputs ) ) , [ theano . tensor . tensor ( dtype = x . type . dtype , broadcastable = x . type . broadcastable ) ] )