https://github.com/Microsoft/CNTK
Raw File
Tip revision: 2003303aba820a91be4b2db9788d15db14cff6dd authored by Frank Seide on 08 September 2020, 19:38:44 UTC
some updates, Marian-related
Tip revision: 2003303
gre.py
from greenlet import greenlet

c = 0
def f1():
  global c
  for i in range(20):
    c += 1
    print("f1", c)
    gr2.switch()

def f2():
  global c
  for i in range(20):
    c += 1
    print("f2", c)
    gr1.switch()

gr1 = greenlet(f1)
gr2 = greenlet(f2)
gr1.switch()
print("done")
back to top