class_docstr: Unit test class for testing scikit-learn converter.
class_docstr_tok: ["Unit","test","class","for","testing","scikit-learn","converter","."]
code: def test_embedding(self):
      from keras.layers import Embedding
  
      model = Sequential()
      num_inputs = 10
      num_outputs = 3
      model.add(Embedding(num_inputs, num_outputs, input_length=5))
  
      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))
  
      # Test the layer parameters.
      layers = spec.neuralNetwork.layers
      layer_0 = layers[0]
      self.assertIsNotNone(layer_0.embedding)
  
      self.assertEquals(layer_0.embedding.inputDim, num_inputs)
      self.assertEquals(layer_0.embedding.outputChannels, num_outputs)
  
      self.assertEquals(
          len(layer_0.embedding.weights.floatValue),
          num_inputs * num_outputs,
      )
  
imports: import unittest
  from coremltools._deps import _HAS_KERAS2_TF
  from coremltools.proto import Model_pb2
  from coremltools.proto import FeatureTypes_pb2
  from coremltools.proto import NeuralNetwork_pb2
  import pytest
label_desc: Use image node_id 18 for calling the KerasSingleLayerTest obj's underlying member method code with example usage: obj.test_embedding() without return types