class_docstr: Base class for networks using Tensorforce layers.
code: def submodule(
      self,
      *,
      name,
      module=None,
      modules=None,
      default_module=None,
      is_trainable=True,
      is_saved=True,
      **kwargs,
  ):
      # Module class and args
      if modules is None:
          modules = layer_modules
      module_cls, args, kwargs = Module.get_module_class_and_args(
          name=name,
          module=module,
          modules=modules,
          default_module=default_module,
          **kwargs,
      )
      if len(args) > 0:
          assert len(kwargs) == 0
          module_cls = args[0]
  
      # Default input_spec
      if not issubclass(module_cls, Layer):
          pass
  
      elif kwargs.get("input_spec") is None:
          if issubclass(module_cls, MultiInputLayer):
              if "tensors" not in kwargs:
                  raise TensorforceError.required(
                      name="MultiInputLayer", argument="tensors"
                  )
              tensors = kwargs["tensors"]
              if isinstance(tensors, str):
                  tensors = (tensors,)
              else:
                  tensors = tuple(tensors)
              if tensors not in self.registered_tensors_spec:
                  raise TensorforceError.exists_not(
                      name="registered tensor", value=kwargs["tensors"]
                  )
              kwargs["input_spec"] = self.registered_tensors_spec[
                  tensors
              ]
  
          elif self._output_spec is None:
              raise TensorforceError.required(
                  name="layer-based network",
                  argument="first layer",
                  expected="retrieve",
                  condition="multiple state/input components",
              )
  
          else:
              kwargs["input_spec"] = self._output_spec
  
      elif issubclass(module_cls, MultiInputLayer):
          raise TensorforceError.invalid(
              name="MultiInputLayer", argument="input_spec"
          )
  
      layer = super().submodule(
          module=module_cls,
          modules=modules,
          default_module=default_module,
          is_trainable=is_trainable,
          is_saved=is_saved,
          **kwargs,
      )
  
      if not isinstance(layer, (Layer, Parameter)):
          raise TensorforceError.type(
              name="layer-based network",
              argument="sub-module",
              value=layer,
          )
  
      elif isinstance(layer, self.invalid_layer_types()):
          raise TensorforceError.type(
              name="network",
              argument="layer",
              value=layer,
              hint="invalid layer type",
          )
  
      if isinstance(layer, Layer):
          self._output_spec = layer.output_spec()
  
          if isinstance(layer, Register):
              if layer.tensor in self.registered_tensors_spec:
                  raise TensorforceError.exists(
                      name="registered tensor", value=layer.tensor
                  )
              self.registered_tensors_spec[
                  layer.tensor
              ] = layer.output_spec()
  
      return layer
  
imports: from collections import Counter
  import tensorflow
  from tensorforce import TensorforceError
  from tensorforce.core import ArrayDict, Module, SignatureDict, TensorDict, TensorSpec, TensorsSpec, tf_function, tf_util
  from tensorforce.core.layers import Block, Layer, layer_modules, MultiInputLayer, NondeterministicLayer, PreprocessingLayer, Register, Reuse, StatefulLayer, TemporalLayer
  from tensorforce.core.parameters import Parameter
label_desc: Use image node_id 9 for calling the LayerbasedNetwork obj's underlying member method code with example usage: obj.submodule() and returns: layer