code: def _infer_lines(B, C, H, W, out_H, out_W, kH, kW):
      target_size = 2**17
      line_size = B * C * (H * W // out_H + kH * kW * out_W)
      target_lines = target_size // line_size
  
      if target_lines < out_H:
          lines = 1
          while True:
              next_lines = lines * 2
              if next_lines > target_lines:
                  break
              lines = next_lines
      else:
          lines = out_H
  
      return lines
  
imports: from __future__ import division
  import numpy
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 1 for calling a global function with example usage: _infer_lines(B, C, H, W, out_H, out_W, kH, kW) and returns: lines