class_docstr: The `NestMap` network processes nested inputs via nested layers.
  
  It is a TF-Agents network that can be used to process nested inputs.
  
  Stateful Keras layers (e.g. LSTMCell, RNN, LSTM, TF-Agents DynamicUnroll)
  are all supported.  The `state_spec` of `NestMap` has a structure matching
  that of `nested_layers`.
  
  `NestMap` can be used in conjunction with `NestFlatten` and a combiner
  (e.g. `tf.keras.layers.Add` or `tf.keras.layers.Concatenate`) to process
  and aggregate in a preprocessing step.
  
  Usage:
  ```python
  net = NestMap({"inp1": layer1, "inp2": layer2})
  outputs, next_state = net({"inp1": inp1, "inp2": inp2}, state)
  ```
class_docstr_tok: ["The","`","NestMap","`","network","processes","nested","inputs","via","nested","layers",".","It","is","a","TF-Agents","network","that","can","be","used","to","process","nested","inputs",".","Stateful","Keras","layers","(","e.g",".","LSTMCell",",","RNN",",","LSTM",",","TF-Agents","DynamicUnroll",")","are","all","supported",".","The","`","state_spec","`","of","`","NestMap","`","has","a","structure","matching","that","of","`","nested_layers","`",".","`","NestMap","`","can","be","used","in","conjunction","with","`","NestFlatten","`","and","a","combiner","(","e.g",".","`","tf.keras.layers.Add","`","or","`","tf.keras.layers.Concatenate","`",")","to","process","and","aggregate","in","a","preprocessing","step",".","Usage",":","``","`","python","net","=","NestMap","(","{","``","inp1","''",":","layer1",",","``","inp2","''",":","layer2","}",")","outputs",",","next_state","=","net","(","{","``","inp1","''",":","inp1",",","``","inp2","''",":","inp2","}",",","state",")","``","`"]
code: def nested_layers(self) -> types.NestedNetwork:
      # Return a shallow copy so users don't modify the layers list.
      return tf.nest.map_structure(lambda m: m, self._nested_layers)
  
file_path: agents/tf_agents/networks/nest_map.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import typing
  import tensorflow.compat.v2
  from tf_agents.networks import network
  from tf_agents.networks import sequential
  from tf_agents.typing import types
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 2 for calling the NestMap obj's underlying member method code with example usage: obj.nested_layers() and returns: tf