MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / popen_with

Function popen_with

tools/tune_inter_intra.py:30–33  ·  view source on GitHub ↗
(inter_threads, intra_threads)

Source from the content-addressed store, hash-verified

28 exit(1)
29
30def popen_with(inter_threads, intra_threads):
31 user_args = [arg for arg in sys.argv[2:] if arg != "--log_profiling"]
32 tune_args = ['--inter_threads', str(inter_threads), '--intra_threads', str(intra_threads), '--log_throughput', '--device', 'cpu']
33 return subprocess.Popen([translate_bin_path] + user_args + tune_args, stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
34
35def performance_with_parameters(inter_threads, intra_threads):
36 translate = popen_with(inter_threads, intra_threads)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected