#NEWLINE# def _sync( self , where ) : #NEWLINE# #INDENT# 'Sync the data in one memory space with the other.' #NEWLINE# if ( self == 'gpu' ) : #NEWLINE# #INDENT# if ( self . _gpu is None ) : #NEWLINE# #INDENT# self . _allocate ( 'gpu' , None , self . dtype , self . shape , self . strides ) #NEWLINE# #UNINDENT# if ( not self . _gpu_valid ) : #NEWLINE# #INDENT# self . _copy_to_gpu ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . _host is None ) : #NEWLINE# #INDENT# self . _allocate ( 'host' , None , self . dtype , self . shape , self . strides ) #NEWLINE# #UNINDENT# if ( not self . _host_valid ) : #NEWLINE# #INDENT# self . _copy_to_host ( )