TANestedTensors¶
- class torchaug.ta_tensors.nested.TANestedTensors(tensors)[source]¶
TANestedTensors is a generic class to handle nested tensors.
A nested tensor is a list of tensors with the same device, dtype, and number of dimensions.
- Parameters:
tensors (
Sequence[TypeVar(T,Image,Video,Labels,BoundingBoxes,Mask,Tensor)]) – The sequence of tensors to nest.- Returns:
_description_
- count(tensor)[source]¶
Return the number of occurrences of a tensor in the nested tensors.
- Return type:
- floor_divide(other)[source]¶
Floor divide the nested tensors by a tensor or a scalar.
- Return type:
Self
- floor_divide_(other)[source]¶
Floor divide the nested tensors by a tensor or a scalar in-place.
- Return type:
Self
- mul_(other)[source]¶
Multiply a tensor or a scalar to the nested tensors in-place.
- Return type:
Self
- remainder(other)[source]¶
Return the remainder of the nested tensors by a tensor or a scalar.
- Return type:
Self
- remainder_(other)[source]¶
Return the remainder of the nested tensors by a tensor or a scalar in-place.
- Return type:
Self
- sub_(other)[source]¶
Subtract a tensor or a scalar to the nested tensors in-place.
- Return type:
Self
- to(device=None, dtype=None, non_blocking=False, copy=False, *, memory_format=None)[source]¶
Move the nested tensors to a new device and/or dtype.
- Return type:
Self
- to_batch()[source]¶
Return the batched tensor and the shapes of the nested tensors.
- Return type:
TypeVar(BATCH_T,BatchImages,BatchBoundingBoxes,BatchLabels,BatchMasks,BatchVideos,Tensor)