(shape, dtype)
| 25 | |
| 26 | |
| 27 | def _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 | |
| 36 | def _producer_proc(shm_name, shape, dtype, ready_q, done_q, error_q): |