#NEWLINE# @ dec . skipif ( ( NumpyVersion ( np . __version__ ) < '1.8.0' ) ) #NEWLINE# def test_sparse_matrix_norms_with_axis( self ) : #NEWLINE# #INDENT# for sparse_type in self . _sparse_types : #NEWLINE# #INDENT# for M in self . _test_matrices : #NEWLINE# #INDENT# S = sparse_type ( M ) #NEWLINE# for axis in ( None , ( 0 , 1 ) , ( 1 , 0 ) ) : #NEWLINE# #INDENT# assert_allclose ( spnorm ( S , axis = axis ) , npnorm ( M , axis = axis ) ) #NEWLINE# for ord in ( 'fro' , np . inf , ( - np . inf ) , 1 , ( - 1 ) ) : #NEWLINE# #INDENT# assert_allclose ( spnorm ( S , ord , axis = axis ) , npnorm ( M , ord , axis = axis ) ) #NEWLINE# #UNINDENT# #UNINDENT# for axis in ( ( ( - 2 ) , ( - 1 ) ) , ( ( - 1 ) , ( - 2 ) ) , ( 1 , ( - 2 ) ) ) : #NEWLINE# #INDENT# assert_allclose ( spnorm ( S , axis = axis ) , npnorm ( M , axis = axis ) ) #NEWLINE# assert_allclose ( spnorm ( S , 'f' , axis = axis ) , npnorm ( M , 'f' , axis = axis ) ) #NEWLINE# assert_allclose ( spnorm ( S , 'fro' , axis = axis ) , npnorm ( M , 'fro' , axis = axis ) )