本文整理汇总了Python中numpy.core.multiarray.dot_函数的典型用法代码示例。如果您正苦于以下问题:Python dot_函数的具体用法?Python dot_怎么用?Python dot_使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dot_函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_all
def test_all(self):
dims = [(),(1,),(1,1)]
for dim1 in dims:
for dim2 in dims:
arg1 = rand(*dim1)
arg2 = rand(*dim2)
c1 = dot(arg1, arg2)
c2 = dot_(arg1, arg2)
assert (c1.shape == c2.shape)
assert_almost_equal(c1, c2, decimal=self.N)
示例2: test_columnvect2
def test_columnvect2(self):
b1 = ones((3,1)).transpose()
b2 = [6.2]
c1 = dot(b2,b1)
c2 = dot_(b2,b1)
assert_almost_equal(c1, c2, decimal=self.N)
示例3: test_columnvect1
def test_columnvect1(self):
b1 = ones((3,1))
b2 = [5.3]
c1 = dot(b1,b2)
c2 = dot_(b1,b2)
assert_almost_equal(c1, c2, decimal=self.N)
示例4: test_vecvecinner
def test_vecvecinner(self):
b1, b3 = self.b1, self.b3
c1 = dot(b3, b1)
c2 = dot_(b3, b1)
assert_almost_equal(c1, c2, decimal=self.N)
示例5: test_vecmat3
def test_vecmat3(self):
A, b4 = self.A, self.b4
c1 = dot(A.transpose(),b4)
c2 = dot_(A.transpose(),b4)
assert_almost_equal(c1, c2, decimal=self.N)
示例6: test_vecmat2
def test_vecmat2(self):
b3, A = self.b3, self.A
c1 = dot(b3, A.transpose())
c2 = dot_(b3, A.transpose())
assert_almost_equal(c1, c2, decimal=self.N)
示例7: test_vecmat
def test_vecmat(self):
A, b4 = self.A, self.b4
c1 = dot(b4, A)
c2 = dot_(b4, A)
assert_almost_equal(c1, c2, decimal=self.N)
示例8: test_matvec2
def test_matvec2(self):
A, b2 = self.A, self.b2
c1 = dot(A, b2)
c2 = dot_(A, b2)
assert_almost_equal(c1, c2, decimal=self.N)
示例9: test_matvec
def test_matvec(self):
A, b1 = self.A, self.b1
c1 = dot(A, b1)
c2 = dot_(A, b1)
assert_almost_equal(c1, c2, decimal=self.N)
示例10: test_matmat
def test_matmat(self):
A = self.A
c1 = dot(A.transpose(), A)
c2 = dot_(A.transpose(), A)
assert_almost_equal(c1, c2, decimal=self.N)
示例11: test_vecscalar2
def test_vecscalar2(self):
b1 = rand(8,1)
b2 = rand(1,1)
c1 = dot(b1,b2)
c2 = dot_(b1,b2)
assert_almost_equal(c1, c2, decimal=self.N)
示例12: check_vecvecouter
def check_vecvecouter(self):
b1, b3 = self.b1, self.b3
c1 = dot(b1, b3)
c2 = dot_(b1, b3)
assert_almost_equal(c1, c2, decimal=self.N)
示例13: check_vecscalar
def check_vecscalar(self):
b1 = rand(1,1)
b2 = rand(1,8)
c1 = dot(b1,b2)
c2 = dot_(b1,b2)
assert_almost_equal(c1, c2, decimal=self.N)