triplet margin loss for input tensors using a custom distance
   function.
Parameters:
      * margin (float, optional) -- Default: 1.
  * **p** (*int**, **optional*) -- The norm degree for pairwise
    distance. Default: 2.

  * **swap** (*bool**, **optional*) -- The distance swap is
    described in detail in the paper *Learning shallow
    convolutional feature descriptors with triplet losses* by V.
    Balntas, E. Riba et al. Default: "False".

  * **size_average** (*bool**, **optional*) -- Deprecated (see
    "reduction"). By default, the losses are averaged over each
    loss element in the batch. Note that for some losses, there
    are multiple elements per sample. If the field "size_average"
    is set to "False", the losses are instead summed for each
    minibatch. Ignored when "reduce" is "False". Default: "True"

  * **reduce** (*bool**, **optional*) -- Deprecated (see
