當前位置: 首頁>>代碼示例>>Python>>正文


Python _umath_tests.test_signature方法代碼示例

本文整理匯總了Python中numpy.core._umath_tests.test_signature方法的典型用法代碼示例。如果您正苦於以下問題:Python _umath_tests.test_signature方法的具體用法?Python _umath_tests.test_signature怎麽用?Python _umath_tests.test_signature使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在numpy.core._umath_tests的用法示例。


在下文中一共展示了_umath_tests.test_signature方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_signature0

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature0(self):
        # the arguments to test_signature are: nin, nout, core_signature
        enabled, num_dims, ixs, flags, sizes = umt.test_signature(
            2, 1, "(i),(i)->()")
        assert_equal(enabled, 1)
        assert_equal(num_dims, (1,  1,  0))
        assert_equal(ixs, (0, 0))
        assert_equal(flags, (self.size_inferred,))
        assert_equal(sizes, (-1,)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:11,代碼來源:test_ufunc.py

示例2: test_signature1

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature1(self):
        # empty core signature; treat as plain ufunc (with trivial core)
        enabled, num_dims, ixs, flags, sizes = umt.test_signature(
            2, 1, "(),()->()")
        assert_equal(enabled, 0)
        assert_equal(num_dims, (0,  0,  0))
        assert_equal(ixs, ())
        assert_equal(flags, ())
        assert_equal(sizes, ()) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:11,代碼來源:test_ufunc.py

示例3: test_signature2

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature2(self):
        # more complicated names for variables
        enabled, num_dims, ixs, flags, sizes = umt.test_signature(
            2, 1, "(i1,i2),(J_1)->(_kAB)")
        assert_equal(enabled, 1)
        assert_equal(num_dims, (2, 1, 1))
        assert_equal(ixs, (0, 1, 2, 3))
        assert_equal(flags, (self.size_inferred,)*4)
        assert_equal(sizes, (-1, -1, -1, -1)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:11,代碼來源:test_ufunc.py

示例4: test_signature3

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature3(self):
        enabled, num_dims, ixs, flags, sizes = umt.test_signature(
            2, 1, u"(i1, i12),   (J_1)->(i12, i2)")
        assert_equal(enabled, 1)
        assert_equal(num_dims, (2, 1, 2))
        assert_equal(ixs, (0, 1, 2, 1, 3))
        assert_equal(flags, (self.size_inferred,)*4)
        assert_equal(sizes, (-1, -1, -1, -1)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:10,代碼來源:test_ufunc.py

示例5: test_signature4

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature4(self):
        # matrix_multiply signature from _umath_tests
        enabled, num_dims, ixs, flags, sizes = umt.test_signature(
            2, 1, "(n,k),(k,m)->(n,m)")
        assert_equal(enabled, 1)
        assert_equal(num_dims, (2, 2, 2))
        assert_equal(ixs, (0, 1, 1, 2, 0, 2))
        assert_equal(flags, (self.size_inferred,)*3)
        assert_equal(sizes, (-1, -1, -1)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:11,代碼來源:test_ufunc.py

示例6: test_signature6

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature6(self):
        enabled, num_dims, ixs, flags, sizes = umt.test_signature(
            1, 1, "(3)->()")
        assert_equal(enabled, 1)
        assert_equal(num_dims, (1, 0))
        assert_equal(ixs, (0,))
        assert_equal(flags, (0,))
        assert_equal(sizes, (3,)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:10,代碼來源:test_ufunc.py

示例7: test_signature7

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature7(self):
        enabled, num_dims, ixs, flags, sizes = umt.test_signature(
            3, 1, "(3),(03,3),(n)->(9)")
        assert_equal(enabled, 1)
        assert_equal(num_dims, (1, 2, 1, 1))
        assert_equal(ixs, (0, 0, 0, 1, 2))
        assert_equal(flags, (0, self.size_inferred, 0))
        assert_equal(sizes, (3, -1, 9)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:10,代碼來源:test_ufunc.py

示例8: test_signature8

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature8(self):
        enabled, num_dims, ixs, flags, sizes = umt.test_signature(
            3, 1, "(3?),(3?,3?),(n)->(9)")
        assert_equal(enabled, 1)
        assert_equal(num_dims, (1, 2, 1, 1))
        assert_equal(ixs, (0, 0, 0, 1, 2))
        assert_equal(flags, (self.can_ignore, self.size_inferred, 0))
        assert_equal(sizes, (3, -1, 9)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:10,代碼來源:test_ufunc.py

示例9: test_signature_failure0

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature_failure0(self):
        # in the following calls, a ValueError should be raised because
        # of error in core signature
        # FIXME These should be using assert_raises

        # error: extra parenthesis
        msg = "core_sig: extra parenthesis"
        try:
            ret = umt.test_signature(2, 1, "((i)),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:14,代碼來源:test_ufunc.py

示例10: test_signature_failure1

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature_failure1(self):
        # error: parenthesis matching
        msg = "core_sig: parenthesis matching"
        try:
            ret = umt.test_signature(2, 1, "(i),)i(->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:10,代碼來源:test_ufunc.py

示例11: test_signature_failure3

# 需要導入模塊: from numpy.core import _umath_tests [as 別名]
# 或者: from numpy.core._umath_tests import test_signature [as 別名]
def test_signature_failure3(self):
        # error: incomplete signature. 2 output arguments are specified
        msg = "core_sig: incomplete signature"
        try:
            ret = umt.test_signature(2, 2, "(i),(i)->()")
            assert_equal(ret, None, err_msg=msg)
        except ValueError:
            pass 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:10,代碼來源:test_ufunc.py


注:本文中的numpy.core._umath_tests.test_signature方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。