code: def locally_connected2d_test_sets():
      def _convert(input, W, output, kwargs):
          return [floatX(input), floatX(W), output, kwargs]
  
      for batch_size in (2, 3):
          for input_shape in (
              (batch_size, 2, 5, 5),
              (batch_size, 4, 8, 8),
          ):
              for num_filters in (2, 4):
                  for filter_size in ((3, 3), (3, 5)):
                      for flip_filters in (True, False):
                          for channelwise in (True, False):
                              if (
                                  channelwise
                                  and num_filters != input_shape[1]
                              ):
                                  continue
                              input = np.random.random(input_shape)
                              if channelwise:
                                  W = np.random.random(
                                      (num_filters,)
                                      + filter_size
                                      + input_shape[2:]
                                  )
                                  output = (
                                      channelwise_locally_connected2d(
                                          input,
                                          W,
                                          flip_filters=flip_filters,
                                      )
                                  )
                              else:
                                  W = np.random.random(
                                      (num_filters, input_shape[1])
                                      + filter_size
                                      + input_shape[2:]
                                  )
                                  output = locally_connected2d(
                                      input,
                                      W,
                                      flip_filters=flip_filters,
                                  )
                              yield _convert(
                                  input,
                                  W,
                                  output,
                                  {
                                      "num_filters": num_filters,
                                      "filter_size": filter_size,
                                      "flip_filters": flip_filters,
                                      "channelwise": channelwise,
                                  },
                              )
  
file_path: Lasagne/lasagne/tests/layers/test_local.py
imports: import numpy
  import pytest
  import theano
  from lasagne.utils import floatX
label_desc: Use image node_id 3 for calling a global function with example usage: locally_connected2d_test_sets() and returns: list