class_docstr: Network consisting of Tensorforce layers (specification key: `custom` or `layered`), which can
  be specified as either a list of layer specifications in the case of a standard sequential
  layer-stack architecture, or as a list of list of layer specifications in the case of a more
  complex architecture consisting of multiple sequential layer-stacks. Note that the final
  action/value layer of the policy/baseline network is implicitly added, so the network output can
  be of arbitrary size and use any activation function, and is only required to be a rank-one
  embedding vector, or optionally have the same shape as the action in the case of a higher-rank
  action shape.
  
  Args:
      layers (iter[specification] | iter[iter[specification]]): Layers configuration, see the
          [layers documentation](../modules/layers.html)
          (<span style="color:#C00000"><b>required</b></span>).
      device (string): Device name
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      l2_regularization (float >= 0.0): Scalar controlling L2 regularization
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      name (string): <span style="color:#0000C0"><b>internal use</b></span>.
      inputs_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
      outputs (iter[string]): <span style="color:#0000C0"><b>internal use</b></span>.
code: def _parse_layers_spec(self, *, spec, counter):
      if isinstance(spec, list):
          return [
              self._parse_layers_spec(spec=s, counter=counter)
              for s in spec
          ]
  
      else:
          if callable(spec):
              spec = dict(type="function", function=spec)
          elif isinstance(spec, str):
              spec = dict(type=spec)
  
          # Deprecated
          if spec.get("type") in (
              "internal_rnn",
              "internal_lstm",
              "internal_gru",
          ):
              raise TensorforceError.deprecated(
                  name="Network layers",
                  argument=spec["type"],
                  replacement=spec["type"][9:],
              )
  
          if "name" in spec:
              spec = dict(spec)
              name = spec.pop("name")
  
          else:
              layer_type = spec.get("type")
              if not isinstance(layer_type, str):
                  layer_type = "layer"
              name = layer_type + str(counter[layer_type])
              counter[layer_type] += 1
  
          return self.submodule(name=name, module=spec)
  
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 4 for calling the LayeredNetwork obj's underlying member method code with example usage: obj._parse_layers_spec() and returns: unknown, self