class_docstr: This class computes the loss function for A2C with continuous action spaces.
  
  Note
  ----
  This class requires tensorflow-probability to be installed.
class_docstr_tok: ["This","class","computes","the","loss","function","for","A2C","with","continuous","action","spaces",".","Note","--","--","This","class","requires","tensorflow-probability","to","be","installed","."]
code: def __call__(self, outputs, labels, weights):
      import tensorflow_probability as tfp
  
      mean = outputs[self.mean_index]
      std = outputs[self.std_index]
      value = outputs[self.value_index]
      reward, advantage = weights
      action = labels[0]
      distrib = tfp.distributions.Normal(mean, std)
      reduce_axes = list(range(1, len(action.shape)))
      log_prob = tf.reduce_sum(distrib.log_prob(action), reduce_axes)
      policy_loss = -tf.reduce_mean(advantage * log_prob)
      value_loss = tf.reduce_mean(tf.square(reward - value))
      entropy = tf.reduce_mean(distrib.entropy())
      return (
          policy_loss
          + self.value_weight * value_loss
          - self.entropy_weight * entropy
      )
  
imports: import time
  from collections.abc import Sequence
  import numpy
  import tensorflow
  from deepchem.models import KerasModel
  from deepchem.models.optimizers import Adam
label_desc: Use image node_id 2 for calling the A2CLossContinuous obj's underlying member method code with example usage: obj.__call__(outputs, labels, weights) and returns: unknown