class_docstr: Example of weight sharing between two different TFModelV2s.
  
  NOTE: This will only work for tf1 (static graph). When running with
  config.framework_str=tf2, use TF2SharedWeightsModel, instead!
  
  Here, we share the variables defined in the 'shared' variable scope
  by entering it explicitly with tf1.AUTO_REUSE. This creates the
  variables for the 'fc1' layer in a global scope called 'shared'
  (outside of the Policy's normal variable scope).
class_docstr_tok: ["Example","of","weight","sharing","between","two","different","TFModelV2s",".","NOTE",":","This","will","only","work","for","tf1","(","static","graph",")",".","When","running","with","config.framework_str=tf2",",","use","TF2SharedWeightsModel",",","instead","!","Here",",","we","share","the","variables","defined","in","the","'shared","'","variable","scope","by","entering","it","explicitly","with","tf1.AUTO_REUSE",".","This","creates","the","variables","for","the","'fc1","'","layer","in","a","global","scope","called","'shared'","(","outside","of","the","Policy","'s","normal","variable","scope",")","."]
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)
      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 SharedWeightsModel1 object from inherited base classes: TFModelV2 with example: obj = SharedWeightsModel1(observation_space, action_space, num_outputs, model_config, name)