class_docstr: YOLO output layer V3.
  Parameters
  ----------
  index : int
      Index of the yolo output layer, to avoid naming conflicts only.
  num_class : int
      Number of foreground objects.
  anchors : iterable
      The anchor setting. Reference: https://arxiv.org/pdf/1804.02767.pdf.
  stride : int
      Stride of feature map.
  alloc_size : tuple of int, default is (128, 128)
      For advanced users. Define `alloc_size` to generate large enough anchor
      maps, which will later saved in parameters. During inference, we support arbitrary
      input image by cropping corresponding area of the anchor map. This allow us
      to export to symbol so we can run it in c++, Scalar, etc.
class_docstr_tok: ["YOLO","output","layer","V3",".","Parameters","--","--","--","--","--","index",":","int","Index","of","the","yolo","output","layer",",","to","avoid","naming","conflicts","only",".","num_class",":","int","Number","of","foreground","objects",".","anchors",":","iterable","The","anchor","setting",".","Reference",":","https",":","\/\/arxiv.org\/pdf\/1804.02767.pdf",".","stride",":","int","Stride","of","feature","map",".","alloc_size",":","tuple","of","int",",","default","is","(","128",",","128",")","For","advanced","users",".","Define","`","alloc_size","`","to","generate","large","enough","anchor","maps",",","which","will","later","saved","in","parameters",".","During","inference",",","we","support","arbitrary","input","image","by","cropping","corresponding","area","of","the","anchor","map",".","This","allow","us","to","export","to","symbol","so","we","can","run","it","in","c++",",","Scalar",",","etc","."]
code: def __init__(
      self,
      index,
      num_class,
      anchors,
      stride,
      alloc_size=(128, 128),
      **kwargs,
  ):
      super(YOLOOutputV3, self).__init__(**kwargs)
      anchors = np.array(anchors).astype("float32")
      self._classes = num_class
      self._num_pred = (
          1 + 4 + num_class
      )  # 1 objness + 4 box + num_class
      self._num_anchors = anchors.size // 2
      self._stride = stride
      with self.name_scope():
          all_pred = self._num_pred * self._num_anchors
          self.prediction = nn.Conv2D(
              all_pred, kernel_size=1, padding=0, strides=1
          )
          # anchors will be multiplied to predictions
          anchors = anchors.reshape(1, 1, -1, 2)
          self.anchors = self.params.get_constant(
              "anchor_%d" % (index), anchors
          )
          # offsets will be added to predictions
          grid_x = np.arange(alloc_size[1])
          grid_y = np.arange(alloc_size[0])
          grid_x, grid_y = np.meshgrid(grid_x, grid_y)
          # stack to (n, n, 2)
          offsets = np.concatenate(
              (grid_x[:, :, np.newaxis], grid_y[:, :, np.newaxis]),
              axis=-1,
          )
          # expand dims to (1, 1, n, n, 2) so it's easier for broadcasting
          offsets = np.expand_dims(
              np.expand_dims(offsets, axis=0), axis=0
          )
          self.offsets = self.params.get_constant(
              "offset_%d" % (index), offsets
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  import os
  import warnings
  import numpy
  import mxnet
  from mxnet import gluon
  from mxnet import autograd
  from mxnet.gluon import nn
  from mxnet.gluon.nn import BatchNorm
  from .darknet import _conv2d, darknet53
  from ..mobilenet import get_mobilenet
  from .yolo_target import YOLOV3TargetMerger
  from ...loss import YOLOV3Loss
label_desc: Use image node_id 1 to create a new YOLOOutputV3 object from inherited base classes: gluon with example: obj = YOLOOutputV3(index, num_class, anchors, stride, alloc_size)