#NEWLINE# def _py_assignment( self ) : #NEWLINE# #INDENT# input_idx = '' . join ( [ ( 'outer_idx_%d,' % ( i , ) ) for i in xrange ( self . n_dims_before ) ] ) #NEWLINE# input_idx += '' . join ( [ ( 'dim_%d_offset+neigh_idx_%d,' % ( i , i ) ) for i in xrange ( len ( self . strides ) ) ] ) #NEWLINE# out_idx = '' . join ( ( [ ( 'outer_idx_%d,' % ( i , ) ) for i in xrange ( self . n_dims_before ) ] + [ ( 'stride_idx_%d,' % ( i , ) ) for i in xrange ( len ( self . strides ) ) ] ) ) #NEWLINE# out_idx += self . _py_flattened_idx ( ) #NEWLINE# return_val = ( '\t' * ( self . n_dims_before + ( len ( self . strides ) * 2 ) ) ) #NEWLINE# if self . inverse : #NEWLINE# #INDENT# return_val += ( 'z[0][%s] = x[%s]\n' % ( input_idx , out_idx ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return_val += ( 'z[0][%s] = x[%s]\n' % ( out_idx , input_idx ) ) #NEWLINE# #UNINDENT# return return_val