Python numpy.core.umath.hypot() Examples

The following are 30 code examples of numpy.core.umath.hypot(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module numpy.core.umath , or try the search function .
Example #1
Source File: test_umath.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def test_no_fpe(self):
        assert_no_warnings(ncu.hypot, np.inf, 0) 
Example #2
Source File: test_umath.py    From Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda with MIT License 5 votes vote down vote up
def test_reduce(self):
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0, 0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([9.0, 12.0, 20.0]), 25.0)
        assert_equal(ncu.hypot.reduce([]), 0.0) 
Example #3
Source File: test_umath.py    From Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda with MIT License 5 votes vote down vote up
def test_simple(self):
        assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
        assert_almost_equal(ncu.hypot(0, 0), 0) 
Example #4
Source File: test_umath.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def test_no_fpe(self):
        assert_no_warnings(ncu.hypot, np.inf, 0) 
Example #5
Source File: test_umath.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_reduce(self):
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0, 0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([9.0, 12.0, 20.0]), 25.0)
        assert_equal(ncu.hypot.reduce([]), 0.0) 
Example #6
Source File: test_umath.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def assert_hypot_isnan(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isnan(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y))) 
Example #7
Source File: test_umath.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def assert_hypot_isinf(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isinf(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y))) 
Example #8
Source File: test_umath.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_no_fpe(self):
        assert_no_warnings(ncu.hypot, np.inf, 0) 
Example #9
Source File: test_umath.py    From keras-lambda with MIT License 5 votes vote down vote up
def test_simple(self):
        assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
        assert_almost_equal(ncu.hypot(0, 0), 0) 
Example #10
Source File: test_umath.py    From keras-lambda with MIT License 5 votes vote down vote up
def assert_hypot_isnan(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isnan(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y))) 
Example #11
Source File: test_umath.py    From keras-lambda with MIT License 5 votes vote down vote up
def assert_hypot_isinf(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isinf(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y))) 
Example #12
Source File: test_umath.py    From keras-lambda with MIT License 5 votes vote down vote up
def test_no_fpe(self):
        assert_no_warnings(ncu.hypot, np.inf, 0) 
Example #13
Source File: test_umath.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_simple(self):
        assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
        assert_almost_equal(ncu.hypot(0, 0), 0) 
Example #14
Source File: test_umath.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def test_reduce(self):
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0, 0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([9.0, 12.0, 20.0]), 25.0)
        assert_equal(ncu.hypot.reduce([]), 0.0) 
Example #15
Source File: test_umath.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def test_simple(self):
        assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
        assert_almost_equal(ncu.hypot(0, 0), 0) 
Example #16
Source File: test_umath.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def assert_hypot_isnan(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isnan(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y))) 
Example #17
Source File: test_umath.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def assert_hypot_isinf(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isinf(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y))) 
Example #18
Source File: test_umath.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def assert_hypot_isnan(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isnan(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y))) 
Example #19
Source File: test_umath.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def test_reduce(self):
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0, 0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([9.0, 12.0, 20.0]), 25.0)
        assert_equal(ncu.hypot.reduce([]), 0.0) 
Example #20
Source File: test_umath.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def test_simple(self):
        assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
        assert_almost_equal(ncu.hypot(0, 0), 0) 
Example #21
Source File: test_umath.py    From ImageFusion with MIT License 5 votes vote down vote up
def test_no_fpe(self):
        assert_no_warnings(ncu.hypot, np.inf, 0) 
Example #22
Source File: test_umath.py    From ImageFusion with MIT License 5 votes vote down vote up
def assert_hypot_isinf(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isinf(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y))) 
Example #23
Source File: test_umath.py    From ImageFusion with MIT License 5 votes vote down vote up
def assert_hypot_isnan(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isnan(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y))) 
Example #24
Source File: test_umath.py    From ImageFusion with MIT License 5 votes vote down vote up
def test_simple(self):
        assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
        assert_almost_equal(ncu.hypot(0, 0), 0) 
Example #25
Source File: test_umath.py    From mxnet-lambda with Apache License 2.0 5 votes vote down vote up
def test_no_fpe(self):
        assert_no_warnings(ncu.hypot, np.inf, 0) 
Example #26
Source File: test_umath.py    From mxnet-lambda with Apache License 2.0 5 votes vote down vote up
def assert_hypot_isinf(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isinf(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y))) 
Example #27
Source File: test_umath.py    From mxnet-lambda with Apache License 2.0 5 votes vote down vote up
def assert_hypot_isnan(x, y):
    with np.errstate(invalid='ignore'):
        assert_(np.isnan(ncu.hypot(x, y)),
                "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y))) 
Example #28
Source File: test_umath.py    From mxnet-lambda with Apache License 2.0 5 votes vote down vote up
def test_reduce(self):
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([3.0, 4.0, 0]), 5.0)
        assert_almost_equal(ncu.hypot.reduce([9.0, 12.0, 20.0]), 25.0)
        assert_equal(ncu.hypot.reduce([]), 0.0) 
Example #29
Source File: test_umath.py    From mxnet-lambda with Apache License 2.0 5 votes vote down vote up
def test_simple(self):
        assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
        assert_almost_equal(ncu.hypot(0, 0), 0) 
Example #30
Source File: test_umath.py    From pySINDy with MIT License 5 votes vote down vote up
def test_no_fpe(self):
        assert_no_warnings(ncu.hypot, np.inf, 0)