code: def _construct_image_vector(
      _input, batch, w, h, filter_width, filter_height, in_shape
  ):
      """Get sliding window of input image.
  
      Args:
          _input (tf.Tensor): Input tf.Tensor to the CNN.
          batch (int): Batch index.
          w (int): Width index.
          h (int): Height index.
          filter_width (int): Width of the filter.
          filter_height (int): Height of the filter.
          in_shape (int): The number of input channels.
  
      Return:
          np.array: The output of the sliding window.
  
      """
      sw = np.empty((filter_width, filter_height, in_shape))
      for dw in range(filter_width):
          for dh in range(filter_height):
              for in_c in range(in_shape):
                  sw[dw][dh][in_c] = _input[batch][w + dw][h + dh][in_c]
      return sw.flatten()
  
file_path: garage/tests/helpers.py
imports: import cloudpickle
  import numpy
  import pytest
  from garage import Environment
  from tests.quirks import KNOWN_GYM_RENDER_NOT_IMPLEMENTED
label_desc: Use image node_id 6 for calling a global function with example usage: _construct_image_vector(_input, batch, w, h, filter_width, filter_height, in_shape) and returns: sw