#NEWLINE# def _fp_convert( src_data , src_type , dest_tensor , reduce_shape ) : #NEWLINE# #INDENT# if reduce_shape : #NEWLINE# #INDENT# kernel = _get_reduce_kernel ( dest_tensor . dtype . str [ 1 : ] ) #NEWLINE# blocks = _ceil_div ( reduce_shape [ 1 ] , 32 ) #NEWLINE# kernel . prepared_async_call ( ( blocks , 1 , 1 ) , ( 32 , 1 , 1 ) , kernel_args . backend . stream , dest_tensor . gpudata , src_data , reduce_shape [ 1 ] , ( reduce_shape [ 0 ] * reduce_shape [ 1 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# from neon.backends.nervanagpu import GPUTensor #NEWLINE# from neon.backends.float_ew import _get_compound_kernel , _get_fast_ew_dims #NEWLINE# ( shape , strides ) = _get_fast_ew_dims ( dest_tensor . size ) #NEWLINE# kernel_args = [ 0 , dest_tensor . gpudata , strides [ 0 ] , strides [ 1 ] , src_data , strides [ 0 ] , strides [ 1 ] , shape [ 1 ] ] #NEWLINE# kernel = _get_compound_kernel ( ( ( GPUTensor , 0 , dest_tensor . dtype . str [ 1 : ] , 0 , False ) , ( GPUTensor , 1 , src_type , 0 , False ) , ( 'assign' , 0 , False , 32 ) ) , dest_tensor . backend . compute_capability ) #NEWLINE# kernel . prepared_async_call ( ( shape [ 0 ] , 1 , 1 ) , ( 32 , 1 , 1 ) , dest_tensor . backend . stream , * kernel_args )