#NEWLINE# def test_dump_load( self ) : #NEWLINE# #INDENT# if ( not cuda_ndarray . cuda_enabled ) : #NEWLINE# #INDENT# raise SkipTest ( 'Optional package cuda disabled' ) #NEWLINE# #UNINDENT# x = CudaNdarraySharedVariable ( 'x' , CudaNdarrayType ( ( 1 , 1 ) , name = 'x' ) , [ [ 1 ] ] , False ) #NEWLINE# with open ( 'test' , 'wb' ) as f : #NEWLINE# #INDENT# dump ( x , f ) #NEWLINE# #UNINDENT# with open ( 'test' , 'rb' ) as f : #NEWLINE# #INDENT# x = load ( f ) #NEWLINE# #UNINDENT# assert ( x . name == 'x' ) #NEWLINE# assert_allclose ( x . get_value ( ) , [ [ 1 ] ] )