()
| 21 | |
| 22 | |
| 23 | def main() -> None: |
| 24 | # TensorBatch - all tensors must have same rank, dtype, and layout |
| 25 | batch = cvcuda.TensorBatch(capacity=10) |
| 26 | tensor1 = cvcuda.Tensor((100, 100, 3), np.uint8, "HWC") |
| 27 | tensor2 = cvcuda.Tensor((150, 200, 3), np.uint8, "HWC") |
| 28 | tensor3 = cvcuda.Tensor((200, 150, 3), np.uint8, "HWC") |
| 29 | batch.pushback([tensor1, tensor2, tensor3]) |
| 30 | |
| 31 | # Different datatypes (each batch needs same dtype) |
| 32 | batch_float = cvcuda.TensorBatch(capacity=5) |
| 33 | t_float1 = cvcuda.Tensor((100, 100, 3), np.float32, "HWC") |
| 34 | t_float2 = cvcuda.Tensor((120, 80, 3), np.float32, "HWC") |
| 35 | batch_float.pushback([t_float1, t_float2]) |
| 36 | |
| 37 | batch_int16 = cvcuda.TensorBatch(capacity=5) |
| 38 | t_int1 = cvcuda.Tensor((50, 50, 1), np.int16, "HWC") |
| 39 | batch_int16.pushback([t_int1]) |
| 40 | |
| 41 | |
| 42 | # docs-end: main |
no test coverage detected