class_docstr: YOLO V3 prefetch target generator.
  The target generated by this instance is invariant to network predictions.
  Therefore it is usually used in DataLoader transform function to reduce the load on GPUs.
  
  Parameters
  ----------
  num_class : int
      Number of foreground classes.
class_docstr_tok: ["YOLO","V3","prefetch","target","generator",".","The","target","generated","by","this","instance","is","invariant","to","network","predictions",".","Therefore","it","is","usually","used","in","DataLoader","transform","function","to","reduce","the","load","on","GPUs",".","Parameters","--","--","--","--","--","num_class",":","int","Number","of","foreground","classes","."]
docstr: since some stages won't see partial anchors, so we have to slice the correct targets
docstr_tok: ["since","some","stages","wo","n't","see","partial","anchors",",","so","we","have","to","slice","the","correct","targets"]
code: def _slice(self, x, num_anchors, num_offsets):
      """since some stages won't see partial anchors, so we have to slice the correct targets"""
      # x with shape (B, N, A, 1 or 2)
      anchors = [0] + num_anchors.tolist()
      offsets = [0] + num_offsets.tolist()
      ret = []
      for i in range(len(num_anchors)):
          y = x[
              :,
              offsets[i] : offsets[i + 1],
              anchors[i] : anchors[i + 1],
              :,
          ]
          ret.append(y.reshape((0, -3, -1)))
      return nd.concat(*ret, dim=1)
  
file_path: gluon-cv/gluoncv/model_zoo/yolo/yolo_target.py
imports: from __future__ import absolute_import
  from __future__ import division
  import numpy
  from mxnet import gluon
  from mxnet import nd
  from mxnet import autograd
  from ...nn.bbox import BBoxCornerToCenter, BBoxCenterToCorner, BBoxBatchIOU
label_desc: Use image node_id 3 for calling the YOLOV3PrefetchTargetGenerator obj's underlying member method code with example usage: obj._slice(x, num_anchors, num_offsets) and returns: nd