コード例 #1
0
 def testgemm_scale_with_out(self):
     for A, B in self.test_matrices:
         result_ref = np.dot(A, B) * 2.
         result = np.empty(result_ref.shape, dtype=A.dtype)
         mathutil.gemm(2., A, B, out=result)
         self.assertTrue(result.flags['C_CONTIGUOUS'])
         np.testing.assert_array_almost_equal(result, result_ref)
コード例 #2
0
 def testgemm_scale_with_out(self):
     for A, B in self.test_matrices:
         result_ref = np.dot(A,B) * 2.
         result = np.empty(result_ref.shape, dtype = A.dtype)
         mathutil.gemm(2., A, B, out=result)
         self.assertTrue(result.flags['C_CONTIGUOUS'])
         np.testing.assert_array_almost_equal(result, result_ref)
コード例 #3
0
ファイル: unittest_mathutil.py プロジェクト: n-zhang/iceberk
 def testgemm_scale(self):
     for A, B in self.test_matrices:
         result = mathutil.gemm(2., A, B)
         result_ref = np.dot(A,B) * 2.
         self.assertTrue(result.flags['C_CONTIGUOUS'])
         np.testing.assert_array_almost_equal(result, result_ref)
コード例 #4
0
 def testgemm_scale(self):
     for A, B in self.test_matrices:
         result = mathutil.gemm(2., A, B)
         result_ref = np.dot(A, B) * 2.
         self.assertTrue(result.flags['C_CONTIGUOUS'])
         np.testing.assert_array_almost_equal(result, result_ref)