def forward(self, features: Tensor, labels: Union[Tensor, List[int]]) -> Tensor:
        """
        Args:
            features: features with shape [batch_size, features_dim]
            labels: labels of samples having batch_size elements

        Returns: loss value

        """
        labels_list = convert_labels2list(labels)

        (
            features_anchor,
            features_positive,
            features_negative,
        ) = self._sampler_inbatch.sample(features=features, labels=labels_list)

        loss = self._triplet_margin_loss(
            anchor=features_anchor,
            positive=features_positive,
            negative=features_negative,
        )
        return loss

        Args:
            features: features with shape [batch_size, features_dim]
            labels: labels of samples having batch_size elements

        Returns: loss value

        
catalyst/contrib/losses/triplet.py