示例#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)
示例#2
0
def test_rad2deg():
    unary_ufunc_check(lambda x: np.rad2deg(x) / 50.0, test_complex=False)
示例#3
0
def test_real_ic(): unary_ufunc_check(np.real_if_close)
def test_imag():    unary_ufunc_check(np.imag)
示例#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])
示例#5
0
def test_radians(): unary_ufunc_check(np.radians, test_complex=False)
def test_sign():    unary_ufunc_check(np.sign)
示例#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])
示例#7
0
def test_exp2():    unary_ufunc_check(np.exp2)
def test_expm1():   unary_ufunc_check(np.expm1)
示例#8
0
def test_cos():     unary_ufunc_check(np.cos)
def test_cosh():    unary_ufunc_check(np.cosh)
示例#9
0
def test_real_ic():
    unary_ufunc_check(np.real_if_close)
示例#10
0
def test_real():
    unary_ufunc_check(np.real)
示例#11
0
def test_tanh():
    unary_ufunc_check(np.tanh)
示例#12
0
def test_tan():
    unary_ufunc_check(np.tan, lims=[-1.1, 1.1])
示例#13
0
def test_square():
    unary_ufunc_check(np.square, test_complex=False)
示例#14
0
def test_sqrt():
    unary_ufunc_check(np.sqrt, lims=[1.0, 3.0])
示例#15
0
def test_radians():
    unary_ufunc_check(np.radians, test_complex=False)
示例#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])
示例#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)
示例#18
0
def test_imag():
    unary_ufunc_check(np.imag)
示例#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)
示例#20
0
def test_conj():
    unary_ufunc_check(np.conj)
示例#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)
示例#22
0
def test_angle():
    unary_ufunc_check(np.angle)
示例#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)
示例#24
0
def test_sin():
    unary_ufunc_check(np.sin)
示例#25
0
def test_sinh():    unary_ufunc_check(np.sinh)
def test_sqrt():    unary_ufunc_check(np.sqrt, lims=[1.0, 3.0])
示例#26
0
def test_absolute():
    unary_ufunc_check(np.absolute, lims=[0.1, 4.0])
示例#27
0
def test_tanh():    unary_ufunc_check(np.tanh)
def test_real():    unary_ufunc_check(np.real)
示例#28
0
def test_arccosh():
    unary_ufunc_check(np.arccosh, lims=[1.1, 4.0])
示例#29
0
def test_conj():    unary_ufunc_check(np.conj)
def test_angle():   unary_ufunc_check(np.angle)
示例#30
0
def test_arctanh():
    unary_ufunc_check(np.arctanh, lims=[-0.9, 0.9])
示例#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])
示例#32
0
def test_ceil():
    unary_ufunc_check(np.ceil, lims=[-1.5, 1.5], test_complex=False)
示例#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])
示例#34
0
def test_cosh():
    unary_ufunc_check(np.cosh)
示例#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)
示例#36
0
def test_deg2rad():
    unary_ufunc_check(np.deg2rad, test_complex=False)
示例#37
0
def test_cosh():    unary_ufunc_check(np.cosh)
def test_deg2rad(): unary_ufunc_check(np.deg2rad, test_complex=False)
示例#38
0
def test_degrees():
    unary_ufunc_check(lambda x: np.degrees(x) / 50.0, test_complex=False)
示例#39
0
def test_exp():     unary_ufunc_check(np.exp)
def test_exp2():    unary_ufunc_check(np.exp2)
示例#40
0
def test_exp():
    unary_ufunc_check(np.exp)
示例#41
0
def test_expm1():   unary_ufunc_check(np.expm1)
def test_fabs():    unary_ufunc_check(np.fabs, test_complex=False)
示例#42
0
 def test_psi():
     unary_ufunc_check(special.psi, lims=[0.3, 2.0], test_complex=False)
示例#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])
示例#44
0
 def test_gammasgn():
     unary_ufunc_check(special.gammasgn,
                       lims=[0.3, 2.0],
                       test_complex=False)
示例#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])
示例#46
0
 def test_rgamma():
     unary_ufunc_check(special.rgamma, lims=[0.3, 2.0], test_complex=False)
示例#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)
示例#48
0
 def test_i1():
     unary_ufunc_check(special.i1, lims=[0.2, 20.0], test_complex=False)
示例#49
0
def test_sin():     unary_ufunc_check(np.sin)
def test_sinh():    unary_ufunc_check(np.sinh)
示例#50
0
 def test_erfc():
     unary_ufunc_check(special.erfc, lims=[-3., 3.], test_complex=True)
示例#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)
示例#52
0
 def test_erfinv():
     unary_ufunc_check(special.erfinv,
                       lims=[-0.95, 0.95],
                       test_complex=False)
示例#53
0
def test_tan():     unary_ufunc_check(np.tan, lims=[-1.1, 1.1])
def test_tanh():    unary_ufunc_check(np.tanh)
示例#54
0
 def test_erfcinv():
     unary_ufunc_check(special.erfcinv,
                       lims=[0.05, 1.95],
                       test_complex=False)
示例#55
0
def test_real():    unary_ufunc_check(np.real)
def test_real_ic(): unary_ufunc_check(np.real_if_close)
示例#56
0
 def test_logit():
     unary_ufunc_check(special.logit, lims=[0.10, 0.90], test_complex=False)
示例#57
0
def test_imag():    unary_ufunc_check(np.imag)
def test_conj():    unary_ufunc_check(np.conj)
示例#58
0
 def test_expit():
     unary_ufunc_check(special.expit,
                       lims=[-4.05, 4.95],
                       test_complex=False)
示例#59
0
def test_angle():   unary_ufunc_check(np.angle)

# Binary ufunc tests

def test_add(): binary_ufunc_check(np.add)
示例#60
0
def test_sin():     unary_ufunc_check(np.sin)
def test_abs():     unary_ufunc_check(np.abs, lims=[0.1, 4.0])