#NEWLINE# def check_backward( self , gpu ) : #NEWLINE# #INDENT# ( gx1 , gx2 ) = self . f . backward ( ( self . x1 , self . x2 ) , ( self . gy1 , self . gy2 ) ) #NEWLINE# self . assertEqual ( self . _get_method ( 'backward' , ( not gpu ) ) . call_count , 0 ) #NEWLINE# self . _get_method ( 'backward' , gpu ) . assert_called_once_with ( ( self . x1 , self . x2 ) , ( self . gy1 , self . gy2 ) ) #NEWLINE# self . assertTrue ( ( cuda . to_cpu ( gx1 ) == cuda . to_cpu ( self . gx1 ) ) . all ( ) ) #NEWLINE# self . assertIsNone ( gx2 )