# tensorplay.nn.functional.triplet_margin_with_distance_loss Source: https://www.tensorplay.cn/docs/generated/tensorplay.nn.functional.triplet_margin_with_distance_loss.html ```python tensorplay.nn.functional.triplet_margin_with_distance_loss(anchor: Tensor, positive: Tensor, negative: Tensor, *, distance_function=None, margin: float = 1.0, swap: bool = False, reduction: str = 'mean') → Tensor ``` Compute the triplet margin loss using a custom distance function. See TripletMarginWithDistanceLoss for details.