class_docstr: Utility class to return constant actions of a desired shape and with given bounds.
code: def core_act(
      self,
      *,
      states,
      internals,
      auxiliaries,
      parallel,
      deterministic,
      independent,
  ):
      assert len(internals) == 0
  
      actions = TensorDict()
      x = tf.shape(input=states.value())[:1]
      for name, spec in self.actions_spec.items():
          shape = tf.concat(
              values=(
                  tf_util.cast(x=x, dtype="int"),
                  tf_util.constant(value=spec.shape, dtype="int"),
              ),
              axis=0,
          )
  
          if (
              self.action_values is not None
              and name in self.action_values
          ):
              # If user-specified, choose given action
              action = tf_util.constant(
                  value=self.action_values[name], dtype=spec.type
              )
              actions[name] = tf.fill(dims=shape, value=action)
  
          elif (
              self.config.enable_int_action_masking
              and spec.type == "int"
              and spec.num_values is not None
          ):
              # If masking, choose first unmasked action
              mask = auxiliaries[name]["mask"]
              choices = tf_util.constant(
                  value=list(range(spec.num_values)),
                  dtype="int",
                  shape=(
                      tuple(1 for _ in spec.shape)
                      + (1, spec.num_values)
                  ),
              )
              one = tf_util.constant(value=1, dtype="int", shape=(1,))
              multiples = tf.concat(values=(shape, one), axis=0)
              choices = tf.tile(input=choices, multiples=multiples)
              choices = tf.boolean_mask(tensor=choices, mask=mask)
              mask = tf_util.cast(x=mask, dtype="int")
              num_valid = tf.math.reduce_sum(
                  input_tensor=mask, axis=(spec.rank + 1)
              )
              num_valid = tf.reshape(tensor=num_valid, shape=(-1,))
              masked_offset = tf.math.cumsum(
                  x=num_valid, axis=0, exclusive=True
              )
              action = tf.gather(params=choices, indices=masked_offset)
              actions[name] = tf.reshape(tensor=action, shape=shape)
  
          elif spec.type != "bool" and spec.min_value is not None:
              if spec.max_value is not None:
                  # If min/max_value given, choose mean action
                  action = spec.min_value + 0.5 * (
                      spec.max_value - spec.min_value
                  )
                  action = tf_util.constant(
                      value=action, dtype=spec.type
                  )
                  actions[name] = tf.fill(dims=shape, value=action)
  
              else:
                  # If only min_value given, choose min_value
                  action = tf_util.constant(
                      value=spec.min_value, dtype=spec.type
                  )
                  actions[name] = tf.fill(dims=shape, value=action)
  
          elif spec.type != "bool" and spec.max_value is not None:
              # If only max_value given, choose max_value
              action = tf_util.constant(
                  value=spec.max_value, dtype=spec.type
              )
              actions[name] = tf.fill(dims=shape, value=action)
  
          else:
              # Else choose zero
              actions[name] = tf_util.zeros(
                  shape=shape, dtype=spec.type
              )
  
      return actions, TensorDict()
  
imports: import tensorflow
  from tensorforce import TensorforceError
  from tensorforce.core import TensorDict, tf_function, tf_util
  from tensorforce.core.models import Model
label_desc: Use image node_id 2 for calling the ConstantModel obj's underlying member method code with example usage: obj.core_act() and returns: actions,  TensorDict