class_docstr: Unit test class for testing scikit-learn converter.
class_docstr_tok: ["Unit","test","class","for","testing","scikit-learn","converter","."]
docstr: Tests the 'respect_trainable' flag on models that have not been
  compiled, and thus do not have a loss function or optimizer.
docstr_tok: ["Tests","the","'respect_trainable","'","flag","on","models","that","have","not","been","compiled",",","and","thus","do","not","have","a","loss","function","or","optimizer","."]
code: def test_updatable_model_flag_no_loss_optimizer(self):
      """
      Tests the 'respect_trainable' flag on models that have not been
      compiled, and thus do not have a loss function or optimizer.
      """
      import coremltools
      from keras.layers import Dense
  
      updatable = Sequential()
      updatable.add(Dense(128, input_shape=(16,)))
      updatable.add(
          Dense(10, name="foo", activation="softmax", trainable=True)
      )
      input = ["data"]
      output = ["output"]
      cml = coremltools.converters.keras.convert(
          updatable, input, output, respect_trainable=True
      )
      spec = cml.get_spec()
      self.assertTrue(spec.isUpdatable)
      layers = spec.neuralNetwork.layers
      self.assertIsNotNone(layers[1].innerProduct)
      self.assertTrue(layers[1].innerProduct)
      self.assertTrue(layers[1].isUpdatable)
  
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 34 for calling the KerasSingleLayerTest obj's underlying member method code with example usage: obj.test_updatable_model_flag_no_loss_optimizer() without return types