예제 #1
0
 def foo(x):
     with objmode_context():
         raise ValueError()
     return x
예제 #2
0
 def foo(x):
     # should specifying nonsense type info be considered valid?
     with objmode_context(k="float64[:]"):
         print(x)
     return x
예제 #3
0
 def foo(x):
     with objmode_context():
         t = {'a': x}
     return x, t
예제 #4
0
 def foo(x):
     with objmode_context(y="float64[:]", z="int64"):
         y = inverse(x)
         z = int(y[0])
     return x, y, z
예제 #5
0
 def foo(x):
     with objmode_context(y='List(int64)'):
         y = [1, 2, 3]
     with objmode_context():
         y[2] = 10
     return y
예제 #6
0
 def foo(x):
     with objmode_context():
         y = 2 + x  # defined but unused outside
         a = np.arange(y)  # defined but unused outside
         bar(a)
     return x
예제 #7
0
 def foo(x):
     with objmode_context(y="float64"):
         y = inverse(x)
     return x, y
예제 #8
0
 def foo(func, x):
     with objmode_context():
         func(x[0])
예제 #9
0
 def foo(x):
     with objmode_context():
         if x == 0:
             return 7
     ret = foo(x - 1)
     return ret
예제 #10
0
 def foo(x):
     with objmode_context():
         dis.dis(foo)
예제 #11
0
 def bar(x):
     with objmode_context(x='int64[:]'):
         print(x)
         return x + j
예제 #12
0
 def foo(x):
     with objmode_context(x='int64[:]'):
         return x
예제 #13
0
 def foo(x):
     with objmode_context(y='int64[:]'):
         y = njit(bar)(x).astype('int64')
     return x + y
예제 #14
0
 def foo(x):
     with objmode_context():
         def bar(y):
             return y + 1
     return x