Ejemplo n.º 1
0
def test_ldexp_neg():   unary_ufunc_check(lambda x: np.ldexp(x, -2), test_complex=False)
# Re-add these tests once we switch to new refactoring that gets rid of NoDerivativeNode
# def test_frexp():       unary_ufunc_check(lambda x: np.frexp(x)[0], lims=[2.1, 2.9], test_complex=False)
# def test_frexp_neg():   unary_ufunc_check(lambda x: np.frexp(x)[0], lims=[-2.1, -2.9], test_complex=False)

# Binary ufunc tests
def test_add():             binary_ufunc_check(np.add)
Ejemplo n.º 2
0
def test_rad2deg():
    unary_ufunc_check(lambda x: np.rad2deg(x) / 50.0, test_complex=False)
Ejemplo n.º 3
0
def test_real_ic(): unary_ufunc_check(np.real_if_close)
def test_imag():    unary_ufunc_check(np.imag)
Ejemplo n.º 4
0
def test_square():  unary_ufunc_check(np.square, test_complex=False)
def test_tan():     unary_ufunc_check(np.tan, lims=[-1.1, 1.1])
Ejemplo n.º 5
0
def test_radians(): unary_ufunc_check(np.radians, test_complex=False)
def test_sign():    unary_ufunc_check(np.sign)
Ejemplo n.º 6
0
def test_log():     unary_ufunc_check(np.log,   lims=[0.2, 2.0])
def test_log10():   unary_ufunc_check(np.log10, lims=[0.2, 2.0])
Ejemplo n.º 7
0
def test_exp2():    unary_ufunc_check(np.exp2)
def test_expm1():   unary_ufunc_check(np.expm1)
Ejemplo n.º 8
0
def test_cos():     unary_ufunc_check(np.cos)
def test_cosh():    unary_ufunc_check(np.cosh)
Ejemplo n.º 9
0
def test_real_ic():
    unary_ufunc_check(np.real_if_close)
Ejemplo n.º 10
0
def test_real():
    unary_ufunc_check(np.real)
Ejemplo n.º 11
0
def test_tanh():
    unary_ufunc_check(np.tanh)
Ejemplo n.º 12
0
def test_tan():
    unary_ufunc_check(np.tan, lims=[-1.1, 1.1])
Ejemplo n.º 13
0
def test_square():
    unary_ufunc_check(np.square, test_complex=False)
Ejemplo n.º 14
0
def test_sqrt():
    unary_ufunc_check(np.sqrt, lims=[1.0, 3.0])
Ejemplo n.º 15
0
def test_radians():
    unary_ufunc_check(np.radians, test_complex=False)
Ejemplo n.º 16
0
def test_arccosh(): unary_ufunc_check(np.arccosh, lims=[1.1, 4.0])
def test_arcsinh(): unary_ufunc_check(np.arcsinh, lims=[-0.9, 0.9])
Ejemplo n.º 17
0
def test_arctanh(): unary_ufunc_check(np.arctanh, lims=[-0.9, 0.9])
def test_ceil():    unary_ufunc_check(np.ceil, lims=[-1.5, 1.5], test_complex=False)
Ejemplo n.º 18
0
def test_imag():
    unary_ufunc_check(np.imag)
Ejemplo n.º 19
0
def test_degrees(): unary_ufunc_check(lambda x : np.degrees(x)/50.0, test_complex=False)
def test_exp():     unary_ufunc_check(np.exp)
Ejemplo n.º 20
0
def test_conj():
    unary_ufunc_check(np.conj)
Ejemplo n.º 21
0
def test_fabs():    unary_ufunc_check(np.fabs, test_complex=False)
def test_floor():   unary_ufunc_check(np.floor, lims=[-1.5, 1.5], test_complex=False)
Ejemplo n.º 22
0
def test_angle():
    unary_ufunc_check(np.angle)
Ejemplo n.º 23
0
def test_log2():    unary_ufunc_check(np.log2,  lims=[0.2, 2.0])
def test_rad2deg(): unary_ufunc_check(lambda x : np.rad2deg(x)/50.0, test_complex=False)
Ejemplo n.º 24
0
def test_sin():
    unary_ufunc_check(np.sin)
Ejemplo n.º 25
0
def test_sinh():    unary_ufunc_check(np.sinh)
def test_sqrt():    unary_ufunc_check(np.sqrt, lims=[1.0, 3.0])
Ejemplo n.º 26
0
def test_absolute():
    unary_ufunc_check(np.absolute, lims=[0.1, 4.0])
Ejemplo n.º 27
0
def test_tanh():    unary_ufunc_check(np.tanh)
def test_real():    unary_ufunc_check(np.real)
Ejemplo n.º 28
0
def test_arccosh():
    unary_ufunc_check(np.arccosh, lims=[1.1, 4.0])
Ejemplo n.º 29
0
def test_conj():    unary_ufunc_check(np.conj)
def test_angle():   unary_ufunc_check(np.angle)
Ejemplo n.º 30
0
def test_arctanh():
    unary_ufunc_check(np.arctanh, lims=[-0.9, 0.9])
Ejemplo n.º 31
0
def test_absolute():unary_ufunc_check(np.absolute, lims=[0.1, 4.0])
def test_arccosh(): unary_ufunc_check(np.arccosh, lims=[1.1, 4.0])
Ejemplo n.º 32
0
def test_ceil():
    unary_ufunc_check(np.ceil, lims=[-1.5, 1.5], test_complex=False)
Ejemplo n.º 33
0
def test_arcsinh(): unary_ufunc_check(np.arcsinh, lims=[-0.9, 0.9])
def test_arctanh(): unary_ufunc_check(np.arctanh, lims=[-0.9, 0.9])
Ejemplo n.º 34
0
def test_cosh():
    unary_ufunc_check(np.cosh)
Ejemplo n.º 35
0
def test_ceil():    unary_ufunc_check(np.ceil, lims=[-1.5, 1.5], test_complex=False)
def test_cos():     unary_ufunc_check(np.cos)
Ejemplo n.º 36
0
def test_deg2rad():
    unary_ufunc_check(np.deg2rad, test_complex=False)
Ejemplo n.º 37
0
def test_cosh():    unary_ufunc_check(np.cosh)
def test_deg2rad(): unary_ufunc_check(np.deg2rad, test_complex=False)
Ejemplo n.º 38
0
def test_degrees():
    unary_ufunc_check(lambda x: np.degrees(x) / 50.0, test_complex=False)
Ejemplo n.º 39
0
def test_exp():     unary_ufunc_check(np.exp)
def test_exp2():    unary_ufunc_check(np.exp2)
Ejemplo n.º 40
0
def test_exp():
    unary_ufunc_check(np.exp)
Ejemplo n.º 41
0
def test_expm1():   unary_ufunc_check(np.expm1)
def test_fabs():    unary_ufunc_check(np.fabs, test_complex=False)
Ejemplo n.º 42
0
 def test_psi():
     unary_ufunc_check(special.psi, lims=[0.3, 2.0], test_complex=False)
Ejemplo n.º 43
0
def test_floor():   unary_ufunc_check(np.floor, lims=[-1.5, 1.5], test_complex=False)
def test_log():     unary_ufunc_check(np.log,   lims=[0.2, 2.0])
Ejemplo n.º 44
0
 def test_gammasgn():
     unary_ufunc_check(special.gammasgn,
                       lims=[0.3, 2.0],
                       test_complex=False)
Ejemplo n.º 45
0
def test_log1p():   unary_ufunc_check(np.log1p, lims=[0.2, 2.0])
def test_log2():    unary_ufunc_check(np.log2,  lims=[0.2, 2.0])
Ejemplo n.º 46
0
 def test_rgamma():
     unary_ufunc_check(special.rgamma, lims=[0.3, 2.0], test_complex=False)
Ejemplo n.º 47
0
def test_rad2deg(): unary_ufunc_check(lambda x : np.rad2deg(x)/50.0, test_complex=False)
def test_radians(): unary_ufunc_check(np.radians, test_complex=False)
Ejemplo n.º 48
0
 def test_i1():
     unary_ufunc_check(special.i1, lims=[0.2, 20.0], test_complex=False)
Ejemplo n.º 49
0
def test_sin():     unary_ufunc_check(np.sin)
def test_sinh():    unary_ufunc_check(np.sinh)
Ejemplo n.º 50
0
 def test_erfc():
     unary_ufunc_check(special.erfc, lims=[-3., 3.], test_complex=True)
Ejemplo n.º 51
0
def test_sqrt():    unary_ufunc_check(np.sqrt, lims=[1.0, 3.0])
def test_square():  unary_ufunc_check(np.square, test_complex=False)
Ejemplo n.º 52
0
 def test_erfinv():
     unary_ufunc_check(special.erfinv,
                       lims=[-0.95, 0.95],
                       test_complex=False)
Ejemplo n.º 53
0
def test_tan():     unary_ufunc_check(np.tan, lims=[-1.1, 1.1])
def test_tanh():    unary_ufunc_check(np.tanh)
Ejemplo n.º 54
0
 def test_erfcinv():
     unary_ufunc_check(special.erfcinv,
                       lims=[0.05, 1.95],
                       test_complex=False)
Ejemplo n.º 55
0
def test_real():    unary_ufunc_check(np.real)
def test_real_ic(): unary_ufunc_check(np.real_if_close)
Ejemplo n.º 56
0
 def test_logit():
     unary_ufunc_check(special.logit, lims=[0.10, 0.90], test_complex=False)
Ejemplo n.º 57
0
def test_imag():    unary_ufunc_check(np.imag)
def test_conj():    unary_ufunc_check(np.conj)
Ejemplo n.º 58
0
 def test_expit():
     unary_ufunc_check(special.expit,
                       lims=[-4.05, 4.95],
                       test_complex=False)
Ejemplo n.º 59
0
def test_angle():   unary_ufunc_check(np.angle)

# Binary ufunc tests

def test_add(): binary_ufunc_check(np.add)
Ejemplo n.º 60
0
def test_sin():     unary_ufunc_check(np.sin)
def test_abs():     unary_ufunc_check(np.abs, lims=[0.1, 4.0])