TensorBatch

class nvcv.TensorBatch

Container for a batch of tensors. The capacity of the container must be specified upfront in the batch initialization. The tensors in the batch may differ in shapes but they must have a uniform dimensionality, data type and layout.

property capacity

Capacity of the tensor batch.

clear(self: nvcv.TensorBatch) None

Remove all images from the TensorBatch.

property dtype

Data type of tensors in the tensor batch. None if the batch is empty.

property layout

Layout of the tensors in the tensor batch. None if the batch is empty.

property ndim

Return the number of dimensions of the tensors or -1 for an empty batch

popback(self: nvcv.TensorBatch, count: int = 1) None

Remove one or more images from the end of the TensorBatch.

pushback(*args, **kwargs)

Overloaded function.

  1. pushback(self: nvcv.TensorBatch, arg0: nvcv.Tensor) -> None

Add a new image to the end of the TensorBatch.

  1. pushback(self: nvcv.TensorBatch, arg0: list[nvcv.Tensor]) -> None

Add multiple images to the end of the TensorBatch.

nvcv.as_tensors(buffers: list[object] = [], layout: Optional[nvcv.TensorLayout] = None) nvcv.TensorBatch

Wrap a list of external buffers as a batch of tensors, and tie the buffers lifetime to it