class_docstr: Configuration for an MLP head.
  
  See _MLPConfig for usage details.
  
  Example:
  
  .. testcode::
  
      # Configuration:
      config = MLPHeadConfig(
          input_dims=[4],  # must be 1D tensor
          hidden_layer_dims=[8, 8],
          hidden_layer_activation="relu",
          hidden_layer_use_layernorm=False,
          # final output layer with no activation (linear)
          output_layer_dim=2,
          output_layer_activation="linear",
      )
      model = config.build(framework="tf2")
  
      # Resulting stack in pseudocode:
      # Linear(4, 8, bias=True)
      # ReLU()
      # Linear(8, 8, bias=True)
      # ReLU()
      # Linear(8, 2, bias=True)
  
  Example:
  
  .. testcode::
  
      # Configuration:
      config = MLPHeadConfig(
          input_dims=[2],
          hidden_layer_dims=[10, 4],
          hidden_layer_activation="silu",
          hidden_layer_use_layernorm=True,
          hidden_layer_use_bias=False,
          # Initializer for `framework="torch"`.
          hidden_layer_weights_initializer="xavier_normal_",
          hidden_layer_weights_initializer_config={"gain": 0.8},
          # No final output layer (use last dim in `hidden_layer_dims`
          # as the size of the last layer in the stack).
          output_layer_dim=None,
      )
      model = config.build(framework="torch")
  
      # Resulting stack in pseudocode:
      # Linear(2, 10, bias=False)
      # LayerNorm((10,))  # layer norm always before activation
      # SiLU()
      # Linear(10, 4, bias=False)
      # LayerNorm((4,))  # layer norm always before activation
      # SiLU()
class_docstr_tok: ["Configuration","for","an","MLP","head",".","See","_MLPConfig","for","usage","details",".","Example",":","..","testcode",":",":","#","Configuration",":","config","=","MLPHeadConfig","(","input_dims=","[","4","]",",","#","must","be","1D","tensor","hidden_layer_dims=","[","8",",","8","]",",","hidden_layer_activation=","''","relu","''",",","hidden_layer_use_layernorm=False",",","#","final","output","layer","with","no","activation","(","linear",")","output_layer_dim=2",",","output_layer_activation=","''","linear","''",",",")","model","=","config.build","(","framework=","''","tf2","''",")","#","Resulting","stack","in","pseudocode",":","#","Linear","(","4",",","8",",","bias=True",")","#","ReLU","(",")","#","Linear","(","8",",","8",",","bias=True",")","#","ReLU","(",")","#","Linear","(","8",",","2",",","bias=True",")","Example",":","..","testcode",":",":","#","Configuration",":","config","=","MLPHeadConfig","(","input_dims=","[","2","]",",","hidden_layer_dims=","[","10",",","4","]",",","hidden_layer_activation=","''","silu","''",",","hidden_layer_use_layernorm=True",",","hidden_layer_use_bias=False",",","#","Initializer","for","`","framework=","''","torch","''","`",".","hidden_layer_weights_initializer=","''","xavier_normal_","''",",","hidden_layer_weights_initializer_config=","{","``","gain","''",":","0.8","}",",","#","No","final","output","layer","(","use","last","dim","in","`","hidden_layer_dims","`","#","as","the","size","of","the","last","layer","in","the","stack",")",".","output_layer_dim=None",",",")","model","=","config.build","(","framework=","''","torch","''",")","#","Resulting","stack","in","pseudocode",":","#","Linear","(","2",",","10",",","bias=False",")","#","LayerNorm","(","(","10",",",")",")","#","layer","norm","always","before","activation","#","SiLU","(",")","#","Linear","(","10",",","4",",","bias=False",")","#","LayerNorm","(","(","4",",",")",")","#","layer","norm","always","before","activation","#","SiLU","(",")"]
code: def build(self, framework: str = "torch") -> "Model":
      self._validate(framework=framework)
  
      if framework == "torch":
          from ray.rllib.core.models.torch.heads import TorchMLPHead
  
          return TorchMLPHead(self)
      else:
          from ray.rllib.core.models.tf.heads import TfMLPHead
  
          return TfMLPHead(self)
  
imports: import abc
  from dataclasses import dataclass, field
  import functools
  from typing import Callable, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
  import numpy
  from ray.rllib.models.torch.misc import same_padding, same_padding_transpose_after_stride, valid_padding
  from ray.rllib.models.utils import get_activation_fn, get_initializer_fn
  from ray.rllib.utils.annotations import ExperimentalAPI
label_desc: Use image node_id 1 for calling the MLPHeadConfig obj's underlying member method code with example usage: obj.build(framework) and returns: TorchMLPHead, TfMLPHead