[docs]classLabelsNestedTensors(TANestedTensors[Labels,BatchLabels]):"""Implement Labels Nested Tensor for PyTorch."""tensors_type=Labelsbatch_tensors_type=BatchLabelstensors:List[Labels]
[docs]defto_batch(self)->BatchLabels:"""Return the batched labels and the shapes of the nested labels."""returnconvert_labels_to_batch_labels(self.tensors)