test_ufunc.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:krpcScripts 作者: jwvanderbeck 项目源码 文件源码
def test_true_divide(self):
        # True_divide has a non uniform signature, see #3484.
        # This also tests type_tuple_type_resolver.
        a = np.full(5, 12.5)
        b = np.full(5, 10.0)
        tgt = np.full(5, 1.25)
        assert_almost_equal(np.true_divide(a, b, dtype=np.float64), tgt)
        assert_almost_equal(np.true_divide(a, b, dtype=np.float32), tgt)
        assert_raises(TypeError, np.true_divide, a, b, dtype=np.int)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号