code: def convNd_test_sets(n):
      def _convert(input, kernel, output, kwargs):
          return [
              theano.shared(floatX(input)),
              floatX(kernel),
              output,
              kwargs,
          ]
  
      extra_shape = (11, 16, 23)
      input_shape = (3, 1) + extra_shape[-n:]
  
      for pad in (0, 1, 2, "full", "same"):
          for stride in (1, 2, 3):
              for filter_size in (1, 3):
                  if stride > filter_size:
                      continue
                  input = np.random.random(input_shape)
                  kernel = np.random.random(
                      (16, 1) + (filter_size,) * n
                  )
                  output = convNd(input, kernel, pad, stride, n=n)
                  yield _convert(
                      input,
                      kernel,
                      output,
                      {
                          "pad": pad,
                          "stride": stride,
                          "flip_filters": True,
                      },
                  )
  
      # bias-less case
      input = np.random.random(input_shape)
      kernel = np.random.random((16, 1) + (3,) * n)
      output = convNd(input, kernel, pad="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},
      )
      # pad='valid' case
      yield _convert(
          input, kernel, output, {"pad": "valid", "flip_filters": True}
      )
      # flip_filters=False case
      flip = (slice(None), slice(None)) + (slice(None, None, -1),) * n
      output = convNd(input, kernel[flip], pad="valid")
      yield _convert(input, kernel, output, {"flip_filters": False})
  
      # num_groups=3 case
      input_shape = (2, 6) + extra_shape[-n:]
      input = np.random.random(input_shape)
      kernel = np.random.random((9, 2) + (3,) * n)
      output = convNd(input, kernel, pad="valid", groups=3)
      yield _convert(
          input, kernel, output, {"num_groups": 3, "flip_filters": True}
      )
  
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 5 for calling a global function with example usage: convNd_test_sets(n) and returns: list