class_docstr: The "other" TFModelV2 using the same shared space as the one above.
class_docstr_tok: ["The","``","other","''","TFModelV2","using","the","same","shared","space","as","the","one","above","."]
code: def __init__(
      self,
      observation_space,
      action_space,
      num_outputs,
      model_config,
      name,
  ):
      super().__init__(
          observation_space,
          action_space,
          num_outputs,
          model_config,
          name,
      )
  
      inputs = tf.keras.layers.Input(observation_space.shape)
  
      # Weights shared with SharedWeightsModel1.
      with tf1.variable_scope(
          tf1.VariableScope(tf1.AUTO_REUSE, "shared"),
          reuse=tf1.AUTO_REUSE,
          auxiliary_name_scope=False,
      ):
          last_layer = tf.keras.layers.Dense(
              units=64, activation=tf.nn.relu, name="fc1"
          )(inputs)
      output = tf.keras.layers.Dense(
          units=num_outputs, activation=None, name="fc_out"
      )(last_layer)
      vf = tf.keras.layers.Dense(
          units=1, activation=None, name="value_out"
      )(last_layer)
      self.base_model = tf.keras.models.Model(inputs, [output, vf])
  
imports: import numpy
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.tf.tf_modelv2 import TFModelV2
  from ray.rllib.models.torch.misc import SlimFC
  from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
label_desc: Use image node_id 1 to create a new SharedWeightsModel2 object from inherited base classes: TFModelV2 with example: obj = SharedWeightsModel2(observation_space, action_space, num_outputs, model_config, name)