MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / _consumer_proc

Function _consumer_proc

tests/operators/test_share_external_data.py:48–56  ·  view source on GitHub ↗
(shm_name, shape, dtype, result_q, error_q)

Source from the content-addressed store, hash-verified

46
47
48def _consumer_proc(shm_name, shape, dtype, result_q, error_q):
49 # Shard data
50 try:
51 paddle.device.set_device("gpu:0")
52 dummy = paddle.zeros(shape, dtype=dtype)
53 shared = share_external_data(dummy, shm_name, shape)
54 result_q.put(("ok", shared.numpy().tolist()))
55 except Exception as e:
56 error_q.put(("consumer_error", str(e)))
57
58
59# Use spawn to avoid forking CUDA contexts

Callers

nothing calls this directly

Calls 2

numpyMethod · 0.80
putMethod · 0.45

Tested by

no test coverage detected