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

Function _create_test_tensor

tests/operators/test_share_external_data.py:27–33  ·  view source on GitHub ↗
(shape, dtype)

Source from the content-addressed store, hash-verified

25
26
27def _create_test_tensor(shape, dtype):
28 if "float" in str(dtype):
29 return paddle.rand(shape=shape, dtype=dtype)
30 elif "int" in str(dtype):
31 return paddle.randint(-100, 100, shape=shape, dtype=dtype)
32 elif "bool" in str(dtype):
33 return paddle.rand(shape=shape, dtype=dtype) > 0.5
34
35
36def _producer_proc(shm_name, shape, dtype, ready_q, done_q, error_q):

Callers 1

_producer_procFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected