docstr: Calculate proper im2col step size, which should be divisible by input_size and not larger
  than prefer_size. Meanwhile the step size should be as large as possible to be more
  efficient. So we choose the largest one among all divisors of input_size which are smaller
  than prefer_size.
  :param input_size: input batch size .
  :param default_size: default preferred im2col step size.
  :return: the largest proper step size.
docstr_tok: ["Calculate","proper","im2col","step","size",",","which","should","be","divisible","by","input_size","and","not","larger","than","prefer_size",".","Meanwhile","the","step","size","should","be","as","large","as","possible","to","be","more","efficient",".","So","we","choose","the","largest","one","among","all","divisors","of","input_size","which","are","smaller","than","prefer_size",".",":","param","input_size",":","input","batch","size",".",":","param","default_size",":","default","preferred","im2col","step","size",".",":","return",":","the","largest","proper","step","size","."]
code: def _cal_im2col_step(input_size, default_size):
      """
      Calculate proper im2col step size, which should be divisible by input_size and not larger
      than prefer_size. Meanwhile the step size should be as large as possible to be more
      efficient. So we choose the largest one among all divisors of input_size which are smaller
      than prefer_size.
      :param input_size: input batch size .
      :param default_size: default preferred im2col step size.
      :return: the largest proper step size.
      """
      if input_size <= default_size:
          return input_size
      best_step = 1
      for step in range(
          2, min(int(math.sqrt(input_size)) + 1, default_size)
      ):
          if input_size % step == 0:
              if input_size // step <= default_size:
                  return input_size // step
              best_step = step
  
      return best_step
  
imports: import math
  from functools import lru_cache
  import torch
  from torch import nn
  from torch.autograd import Function
  from torch.autograd.function import once_differentiable
  from torch.nn.modules.utils import _pair
  from torchvision.ops import deform_conv2d
  from detectron2.utils.develop import create_dummy_class, create_dummy_func
  from .wrappers import _NewEmptyTensorOp
label_desc: Use image node_id 4 for calling the _DeformConv obj's underlying member method code with example usage: obj._cal_im2col_step(input_size, default_size) and returns: best_step, input_size, unknown