title: How to use keras layers in custom keras layer
body: <p>I am trying to write my own keras layer. In this layer, I want to use some other keras layers. Is there any way to do something like this:</p>
  
  <pre><code>class MyDenseLayer(tf.keras.layers.Layer):
    def __init__(self, num_outputs):
      super(MyDenseLayer, self).__init__()
      self.num_outputs = num_outputs
  
    def build(self, input_shape):
      self.fc = tf.keras.layers.Dense(self.num_outputs)
  
    def call(self, input):
      return self.fc(input)
  
  layer = MyDenseLayer(10)
  </code></pre>
  
  <p>When I do something like</p>
  
  <pre><code>input = tf.keras.layers.Input(shape = (16,))
  output = MyDenseLayer(10)(input)
  model = tf.keras.Model(inputs = [input], outputs = [output])
  model.summary()
  </code></pre>
  
  <p>it outputs 
  <a href="https://i.stack.imgur.com/8BTmV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8BTmV.png" alt="enter image description here"></a></p>
  
  <p>How do I make weiths in the dense there trainable?</p>