#NEWLINE# def test_safe_add( ) : #NEWLINE# #INDENT# X1 = np . zeros ( ( 4 , 13 ) , dtype = np . float64 ) #NEWLINE# X2 = X1 . copy ( ) #NEWLINE# Y = csr_matrix ( ( np . arange ( ( 4 * 13 ) , dtype = np . float64 ) . reshape ( 4 , 13 ) % 4 ) ) #NEWLINE# X1 += Y #NEWLINE# safe_add ( X2 , Y ) #NEWLINE# assert_array_equal ( X1 , X2 ) #NEWLINE# X = np . zeros ( ( 13 , 4 ) , dtype = np . float64 ) #NEWLINE# YT = Y . T #NEWLINE# safe_add ( X , YT ) #NEWLINE# assert_array_equal ( X1 , X . T )