code: def transp_conv2d_test_sets():
      def _convert(input, kernel, output, kwargs):
          return [floatX(input), floatX(kernel), output, kwargs]
  
      input_shape = (3, 1, 11, 16)
      for crop in (0, 1, 2, "full", "same"):
          for stride in (1, 2, 3):
              for filter_size in (1, 3):
                  if stride > filter_size:
                      continue
                  if crop not in ("full", "same") and crop > (
                      filter_size - 1
                  ):
                      continue
                  input = np.random.random(input_shape)
                  kernel = np.random.random(
                      (16, 1, filter_size, filter_size)
                  )
                  output = transposed_convNd(
                      input, kernel, crop, stride, 2
                  )
                  yield _convert(
                      input,
                      kernel,
                      output,
                      {
                          "crop": crop,
                          "stride": stride,
                          "flip_filters": True,
                      },
                  )
  
      # bias-less case
      input = np.random.random(input_shape)
      kernel = np.random.random((16, 1, 3, 3))
      output = transposed_convNd(input, kernel, "valid")
      yield _convert(
          input, kernel, output, {"b": None, "flip_filters": True}
      )
      # untie_biases=True case
      yield _convert(
          input,
          kernel,
          output,
          {"untie_biases": True, "flip_filters": True},
      )
      # crop='valid' case
      yield _convert(
          input, kernel, output, {"crop": "valid", "flip_filters": True}
      )
      # flip_filters=False case
      output = transposed_convNd(
          input, kernel[:, :, ::-1, ::-1], "valid"
      )
      yield _convert(input, kernel, output, {"flip_filters": False})
      # extend (w/ and w/out symbolic output shape)
      for symbolic in [False, True]:
          input_shape = (4, 3, 7, 9)
          input = np.random.random(input_shape)
          kernel = np.random.random((16, 3, 2, 3))
          stride = (2, 3)
          for extend in [(0, 1), (1, 2)]:
              output = transposed_convNd(
                  input, kernel, 0, stride, extend=extend
              )
              kwargs = {"stride": stride, "flip_filters": True}
              if symbolic:
                  kwargs["output_size"] = theano.shared(
                      np.array(output.shape[2:])
                  )
              else:
                  kwargs["output_size"] = output.shape[2:]
              yield _convert(input, kernel, output, kwargs)
  
imports: import numpy
  import pytest
  import importlib
  import theano
  from theano import tensor
  import lasagne
  from lasagne.utils import floatX, as_tuple
label_desc: Use image node_id 9 for calling a global function with example usage: transp_conv2d_test_sets() and returns: list