class_docstr: Unit test class for testing scikit-learn converter.
docstr: Test the conversion of 2D convolutional layer.
docstr_tok: ["Test","the","conversion","of","2D","convolutional","layer","."]
code: def test_convolution(self):
      """
      Test the conversion of 2D convolutional layer.
      """
      from keras.layers import Convolution2D
  
      # Create a simple Keras model
      model = Sequential()
      model.add(
          Convolution2D(
              input_shape=(64, 64, 3),
              nb_filter=32,
              nb_row=5,
              nb_col=5,
              init="glorot_uniform",
              activation=None,
              weights=None,
              border_mode="valid",
              subsample=(1, 1),
              bias=True,
          )
      )
      input_names = ["input"]
      output_names = ["output"]
      spec = keras.convert(model, input_names, output_names).get_spec()
      self.assertIsNotNone(spec)
  
      # Test the model class
      self.assertIsNotNone(spec.description)
      self.assertTrue(spec.HasField("neuralNetwork"))
  
      # Test the inputs and outputs
      self.assertEquals(len(spec.description.input), len(input_names))
      six.assertCountEqual(
          self, input_names, [x.name for x in spec.description.input]
      )
      self.assertEquals(len(spec.description.output), len(output_names))
      six.assertCountEqual(
          self, output_names, [x.name for x in spec.description.output]
      )
  
      # Test the layer parameters.
      layers = spec.neuralNetwork.layers
      layer_0 = layers[0]
      self.assertIsNotNone(layer_0.convolution)
  
imports: import unittest
  from coremltools._deps import _HAS_KERAS_TF
  from coremltools.proto import FeatureTypes_pb2
  import pytest
  import six
label_desc: Use image node_id 6 for calling the KerasSingleLayerTest obj's underlying member method code with example usage: obj.test_convolution() without return types