https://github.com/Microsoft/CNTK
Raw File
Tip revision: fb8c7fcf00bd06aec08ee31d3ea078858a589fc7 authored by Frank Seide on 03 June 2017, 17:56:37 UTC
changed PrimitiveAsComposite() to directly calling CompositeFunction::Create()
Tip revision: fb8c7fc
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