docstr: Test whether matrix.sum(axis=1) preserves orientation.
  Fails in NumPy <= 0.9.6.2127.
docstr_tok: ["Test","whether","matrix.sum","(","axis=1",")","preserves","orientation",".","Fails","in","NumPy","<","=","0.9.6.2127","."]
code: def test_sum(self):
      """Test whether matrix.sum(axis=1) preserves orientation.
      Fails in NumPy <= 0.9.6.2127.
      """
      M = matrix(
          [[1, 2, 0, 0], [3, 4, 0, 0], [1, 2, 1, 2], [3, 4, 3, 4]]
      )
      sum0 = matrix([8, 12, 4, 6])
      sum1 = matrix([3, 7, 6, 14]).T
      sumall = 30
      assert_array_equal(sum0, M.sum(axis=0))
      assert_array_equal(sum1, M.sum(axis=1))
      assert_equal(sumall, M.sum())
  
      assert_array_equal(sum0, np.sum(M, axis=0))
      assert_array_equal(sum1, np.sum(M, axis=1))
      assert_equal(sumall, np.sum(M))
  
imports: import collections.abc
  import numpy
  from numpy import matrix, asmatrix, bmat
  from numpy.testing import assert_, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_raises
  from numpy.linalg import matrix_power
label_desc: Use image node_id 1 for calling the TestProperties obj's underlying member method code with example usage: obj.test_sum() without return types