#NEWLINE# def make_node( self , x , ilist ) : #NEWLINE# #INDENT# x_ = theano . tensor . as_tensor_variable ( x ) #NEWLINE# ilist_ = theano . tensor . as_tensor_variable ( x_ ) #NEWLINE# if ( ilist_ . type . dtype [ : 3 ] not in ( 'int' , 'uin' ) ) : #NEWLINE# #INDENT# raise TypeError ( 'index must be integers' ) #NEWLINE# #UNINDENT# if ( ilist_ . type . ndim != 1 ) : #NEWLINE# #INDENT# raise TypeError ( 'index must be vector' ) #NEWLINE# #UNINDENT# if ( x_ . type . ndim == 0 ) : #NEWLINE# #INDENT# raise TypeError ( 'cannot index into a scalar' ) #NEWLINE# #UNINDENT# bcast = ( ( ilist_ . broadcastable [ 0 ] , ) + x_ . broadcastable [ 1 : ] ) #NEWLINE# return Apply ( self , [ x_ , ilist_ ] , [ TensorType ( dtype = x . dtype , broadcastable = bcast ) ( ) ] )