class_docstr: This generate anchors.
  
  Parameters
  ----------
  stride : int
      Anchor stride
  ratios : tuple
      Anchor ratios
  scales : tuple
      Anchor scales
  size : int
      anchor size
class_docstr_tok: ["This","generate","anchors",".","Parameters","--","--","--","--","--","stride",":","int","Anchor","stride","ratios",":","tuple","Anchor","ratios","scales",":","tuple","Anchor","scales","size",":","int","anchor","size"]
docstr: generate all anchors
  
  Parameters
  ----------
  im_c: int
      image center
  size:
      image size
docstr_tok: ["generate","all","anchors","Parameters","--","--","--","--","--","im_c",":","int","image","center","size",":","image","size"]
code: def generate_all_anchors(self, im_c, size):
      """
      generate all anchors
  
      Parameters
      ----------
      im_c: int
          image center
      size:
          image size
      """
      if self.image_center == im_c and self.size == size:
          return False
      self.image_center = im_c
      self.size = size
  
      a0x = im_c - size // 2 * self.stride
      ori = np.array([a0x] * 4, dtype=np.float32)
      zero_anchors = self.anchors + ori
  
      x1 = zero_anchors[:, 0]
      y1 = zero_anchors[:, 1]
      x2 = zero_anchors[:, 2]
      y2 = zero_anchors[:, 3]
  
      x1, y1, x2, y2 = map(
          lambda x: x.reshape(self.anchor_num, 1, 1), [x1, y1, x2, y2]
      )
      cx, cy, w, h = corner2center([x1, y1, x2, y2])
  
      disp_x = np.arange(0, size).reshape(1, 1, -1) * self.stride
      disp_y = np.arange(0, size).reshape(1, -1, 1) * self.stride
  
      cx = cx + disp_x
      cy = cy + disp_y
  
      # broadcast
      zero = np.zeros((self.anchor_num, size, size), dtype=np.float32)
      cx, cy, w, h = map(lambda x: x + zero, [cx, cy, w, h])
      x1, y1, x2, y2 = center2corner([cx, cy, w, h])
  
      self.all_anchors = (
          np.stack([x1, y1, x2, y2]).astype(np.float32),
          np.stack([cx, cy, w, h]).astype(np.float32),
      )
      return True
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import math
  from collections import namedtuple
  import numpy
  import mxnet
  from mxnet import nd
  from gluoncv.utils.filesystem import try_import_cv2
label_desc: Use image node_id 3 for calling the Anchors obj's underlying member method code with example usage: obj.generate_all_anchors(im_c, size) and returns: True, False