docstr: Create Class definitions for different ways of writing DictLayer.
docstr_tok: ["Create","Class","definitions","for","different","ways","of","writing","DictLayer","."]
code: def setUp(self):
      """Create Class definitions for different ways of writing DictLayer."""
      super().setUp()
      self.x = tf.ones([2, 5])
      n_out = 10
      self.n_out = n_out
  
      class TestLayer(nn.DictLayer):
          """Explicitly sets input/output keys."""
  
          def __init__(
              self,
              input_keys=("x1", "x2"),
              output_keys=("y1", "y2", "y3"),
              **kwargs,
          ):
              super().__init__(input_keys, output_keys, **kwargs)
              self.dense = tfkl.Dense(n_out)
  
          def call(self, x1, x2):
              y1, y2, y3 = (
                  self.dense(x1),
                  self.dense(x2),
                  self.dense(x1),
              )
              return y1, y2, y3
  
      self.TestLayer = TestLayer  # pylint: disable=invalid-name
  
      class TestLayerAnnotated(nn.DictLayer):
          """Uses args and return annotations to define input/output keys."""
  
          def __init__(self, **kwargs):
              super().__init__(**kwargs)
              self.dense = tfkl.Dense(n_out)
  
          def call(self, x1, x2) -> ["y1", "y2", "y3"]:
              y1, y2, y3 = (
                  self.dense(x1),
                  self.dense(x2),
                  self.dense(x1),
              )
              return y1, y2, y3
  
      self.TestLayerAnnotated = (
          TestLayerAnnotated  # pylint: disable=invalid-name
      )
  
      class TestLayerDefaults(nn.DictLayer):
          """Uses args and return annotations, and default arg inputs."""
  
          def __init__(self, **kwargs):
              super().__init__(**kwargs)
              self.dense = tfkl.Dense(n_out)
  
          def call(self, x1, x2=None) -> ["y1", "y2", "y3"]:
              y1, y3 = self.dense(x1), self.dense(x1)
              y2 = self.dense(x2) if x2 is not None else self.dense(x1)
              return y1, y2, y3
  
      self.TestLayerDefaults = (
          TestLayerDefaults  # pylint: disable=invalid-name
      )
  
      class TestLayerOptionals(nn.DictLayer):
          """Uses args and return annotations, and default arg inputs."""
  
          def call(self, x1, x2=None, x3=None) -> ["y"]:
              """Optionally add multiples of each input."""
              y = x1
              if x2 is not None:
                  y += 2.0 * x2
              if x3 is not None:
                  y += 3.0 * x3
              return y
  
      self.TestLayerOptionals = TestLayerOptionals
  
imports: from absl.testing import parameterized
  from ddsp.training import nn
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling the DictLayerTest obj's underlying member method code with example usage: obj.setUp() and returns: y1,  y2,  y3, y1,  y2,  y3, y1,  y2,  y3, y