class_docstr: Abstract two-dimensional layer that downsamples values in a kernel to a single value.
  
  Parameters
  ----------
  input_size : tuple
      the size of the input.
  output_size : tuple
      the size of the output.
  strides : matrix-like
      stride of the kernel.
  activation : str or None
      activation function name
  input_index_mapper : IndexMapper or None
      map indexes from this layer index to the input layer index size
docstr: Returns an iterator over the index within the kernel and input index
  for the output at index `(out_d, out_r, out_c)`.
  
  Parameters
  ----------
  out_d : int
      the output depth.
  out_r : int
      the output row.
  out_c : int
      the output column.
docstr_tok: ["Returns","an","iterator","over","the","index","within","the","kernel","and","input","index","for","the","output","at","index","`","(","out_d",",","out_r",",","out_c",")","`",".","Parameters","--","--","--","--","--","out_d",":","int","the","output","depth",".","out_r",":","int","the","output","row",".","out_c",":","int","the","output","column","."]
code: def kernel_index_with_input_indexes(self, out_d, out_r, out_c):
      """
      Returns an iterator over the index within the kernel and input index
      for the output at index `(out_d, out_r, out_c)`.
  
      Parameters
      ----------
      out_d : int
          the output depth.
      out_r : int
          the output row.
      out_c : int
          the output column.
      """
      kernel_d = self.kernel_depth
      [kernel_r, kernel_c] = self.kernel_shape
      [rows_stride, cols_stride] = self.__strides
      start_in_d = 0
      start_in_r = out_r * rows_stride
      start_in_c = out_c * cols_stride
      mapper = lambda x: x
      if self.input_index_mapper is not None:
          mapper = self.input_index_mapper
  
      for k_d in range(kernel_d):
          for k_r in range(kernel_r):
              for k_c in range(kernel_c):
                  input_index = (
                      start_in_d + k_d,
                      start_in_r + k_r,
                      start_in_c + k_c,
                  )
  
                  assert len(input_index) == len(self.input_size)
                  # don't yield an out-of-bounds input index;
                  # can happen if ceil mode is enabled for pooling layers
                  # as this could require using a partial kernel
                  # even though we loop over ALL kernel indexes.
                  if not all(
                      input_index[i] < self.input_size[i]
                      for i in range(len(input_index))
                  ):
                      continue
                  yield (k_d, k_r, k_c), input_index
  
imports: import itertools
  import numpy
label_desc: Use image node_id 5 for calling the Layer2D obj's underlying member method code with example usage: obj.kernel_index_with_input_indexes(out_d, out_r, out_c) without return types