MCPcopy Index your code
hub / github.com/apache/tvm / map_with_error_catching

Method map_with_error_catching

python/tvm/support/popen_pool.py:466–483  ·  view source on GitHub ↗

Same as map, but catches exceptions and return them instead. Parameters ---------- fn : function The function to be invoked. iterator : Iterator Input iterator. Returns ------- out_iter : Iterator[MapResult]

(self, fn, iterator)

Source from the content-addressed store, hash-verified

464 return self._threadpool.submit(worker, fn, args, kwargs)
465
466 def map_with_error_catching(self, fn, iterator):
467 """Same as map, but catches exceptions and return them instead.
468
469 Parameters
470 ----------
471 fn : function
472 The function to be invoked.
473
474 iterator : Iterator
475 Input iterator.
476
477 Returns
478 -------
479 out_iter : Iterator[MapResult]
480 The result iterator.
481 """
482 worker = lambda x: self._worker_run_with_error_catching(fn, (x,), None)
483 return self._threadpool.map(worker, iterator)

Callers 2

buildMethod · 0.95
test_popen_pool_executorFunction · 0.95

Calls 1

Tested by 1

test_popen_pool_executorFunction · 0.76