(x)
| 75 | coordination_events = {i: threading.Event() for i in range(num_elements)} |
| 76 | |
| 77 | def map_py_fn(x): |
| 78 | coordination_events[x].wait() |
| 79 | coordination_events[x].clear() |
| 80 | return x * x |
| 81 | |
| 82 | def map_fn(x): |
| 83 | return script_ops.py_func(map_py_fn, [x], x.dtype) |