code: def __get_anchors(
      self,
      anchors: Union[List[int], Tuple[int, ...]],
      anchor_masks: Tuple[int, int, int],
  ) -> torch.Tensor:
      a = [
          (anchors[i], anchors[i + 1])
          for i in range(0, len(anchors), 2)
      ]
      return torch.tensor([a[i] for i in anchor_masks]).to(self.device)
  
imports: from typing import Union, List, Tuple, Optional
  import torch
  import torch.nn
  import numpy
  from .utils import transform_prediction
label_desc: Use image node_id 2 for calling the DetectionLayer obj's underlying member method code with example usage: obj.__get_anchors(anchors, anchor_masks) and returns: torch