code: def regularize(self, *, states, horizons, internals, auxiliaries):
      regularization_loss = super().regularize()
  
      # Entropy regularization
      if not self.entropy_regularization.is_constant(value=0.0):
          zero = tf_util.constant(value=0.0, dtype="float")
          entropy_regularization = self.entropy_regularization.value()
  
          def no_entropy_regularization():
              return zero
  
          def apply_entropy_regularization():
              entropy = self.policy.entropy(
                  states=states,
                  horizons=horizons,
                  internals=internals,
                  auxiliaries=auxiliaries,
              )
              entropy = tf.math.reduce_mean(
                  input_tensor=entropy, axis=0
              )
              return -entropy_regularization * entropy
  
          regularization_loss += tf.cond(
              pred=tf.math.equal(x=entropy_regularization, y=zero),
              true_fn=no_entropy_regularization,
              false_fn=apply_entropy_regularization,
          )
  
      return regularization_loss
  
imports: import logging
  import tensorflow
  from tensorforce import TensorforceError
  from tensorforce.core import ModuleDict, memory_modules, optimizer_modules, parameter_modules, SignatureDict, TensorDict, TensorSpec, TensorsSpec, tf_function, tf_util, VariableDict
  from tensorforce.core.models import Model
  from tensorforce.core.networks import Preprocessor
  from tensorforce.core.objectives import objective_modules
  from tensorforce.core.policies import policy_modules, StochasticPolicy
label_desc: Use image node_id 21 for calling the TensorforceModel obj's underlying member method code with example usage: obj.regularize() and returns: regularization_loss, zero, unknown