class_docstr: Implements the loss as the sum of the followings:
  1. Confidence Loss: All labels, with hard negative mining
  2. Localization Loss: Only on positive labels
  Suppose input dboxes has the shape 8732x4
class_docstr_tok: ["Implements","the","loss","as","the","sum","of","the","followings",":","1",".","Confidence","Loss",":","All","labels",",","with","hard","negative","mining","2",".","Localization","Loss",":","Only","on","positive","labels","Suppose","input","dboxes","has","the","shape","8732x4"]
docstr: Generate Location Vectors
docstr_tok: ["Generate","Location","Vectors"]
code: def _loc_vec(self, loc):
      """
      Generate Location Vectors
      """
      gxy = (
          self.scale_xy
          * (loc[:, :2, :] - self.dboxes[:, :2, :])
          / self.dboxes[
              :,
              2:,
          ]
      )
      gwh = (
          self.scale_wh * (loc[:, 2:, :] / self.dboxes[:, 2:, :]).log()
      )
      return torch.cat((gxy, gwh), dim=1).contiguous()
  
imports: import torch
  import torch.nn
  from torchvision.models.resnet import resnet18, resnet34, resnet50, resnet101, resnet152
  from torch.nn.parallel import DistributedDataParallel
label_desc: Use image node_id 2 for calling the Loss obj's underlying member method code with example usage: obj._loc_vec(loc) and returns: torch