code: def test_infer_shape(self):
      shape = (100, 40, 6, 3)
      images = np.ones(shape).astype("float32")
      x = T.ftensor4()
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(2, 1), mode="valid")],
          [images],
          Images2Neibs,
      )
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(2, 3), mode="valid")],
          [images],
          Images2Neibs,
      )
      shape = (100, 40, 5, 4)
      images = np.ones(shape).astype("float32")
      x = T.ftensor4()
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(2, 1), mode="ignore_borders")],
          [images],
          Images2Neibs,
      )
      shape = (100, 40, 5, 3)
      images = np.ones(shape).astype("float32")
      x = T.ftensor4()
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(2, 3), mode="ignore_borders")],
          [images],
          Images2Neibs,
      )
  
      shape = (100, 40, 6, 7)
      images = np.ones(shape).astype("float32")
      x = T.ftensor4()
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(2, 2), mode="ignore_borders")],
          [images],
          Images2Neibs,
      )
      shape = (100, 40, 5, 10)
      images = np.ones(shape).astype("float32")
      x = T.ftensor4()
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(3, 3), mode="wrap_centered")],
          [images],
          Images2Neibs,
      )
      shape = (100, 40, 6, 4)
      images = np.ones(shape).astype("float32")
      x = T.ftensor4()
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(2, 1), mode="half")],
          [images],
          Images2Neibs,
      )
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(2, 3), mode="half")],
          [images],
          Images2Neibs,
      )
      shape = (100, 40, 6, 5)
      images = np.ones(shape).astype("float32")
      x = T.ftensor4()
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(2, 1), mode="full")],
          [images],
          Images2Neibs,
      )
      self._compile_and_check(
          [x],
          [images2neibs(x, neib_shape=(2, 3), mode="full")],
          [images],
          Images2Neibs,
      )
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import unittest
  import theano
  from theano import shared, function
  import theano.tensor
  from theano.tensor.nnet.neighbours import images2neibs, neibs2images, Images2Neibs
  from theano.tests import unittest_tools
  from theano import change_flags
label_desc: Use image node_id 23 for calling the T_Images2Neibs obj's underlying member method code with example usage: obj.test_infer_shape() without return types