docstr: Calculate log probabilities of actions, when given means and logvars
      of normal distribution.
      The constant sqrt(2 * pi) is omitted, which will be eliminated in later.
  
  Args:
      actions: shape (batch_size, act_dim)
      means:   shape (batch_size, act_dim)
      logvars: shape (act_dim)
  
  Returns:
      logprob: shape (batch_size)
docstr_tok: ["Calculate","log","probabilities","of","actions",",","when","given","means","and","logvars","of","normal","distribution",".","The","constant","sqrt","(","2","*","pi",")","is","omitted",",","which","will","be","eliminated","in","later",".","Args",":","actions",":","shape","(","batch_size",",","act_dim",")","means",":","shape","(","batch_size",",","act_dim",")","logvars",":","shape","(","act_dim",")","Returns",":","logprob",":","shape","(","batch_size",")"]
code: def _calc_logprob(self, actions, means, logvars):
      """Calculate log probabilities of actions, when given means and logvars
          of normal distribution.
          The constant sqrt(2 * pi) is omitted, which will be eliminated in later.
  
      Args:
          actions: shape (batch_size, act_dim)
          means:   shape (batch_size, act_dim)
          logvars: shape (act_dim)
  
      Returns:
          logprob: shape (batch_size)
      """
      exp_item = layers.elementwise_div(
          layers.square(actions - means), layers.exp(logvars), axis=1
      )
      exp_item = -0.5 * layers.reduce_sum(exp_item, dim=1)
  
      vars_item = -0.5 * layers.reduce_sum(logvars)
      logprob = exp_item + vars_item
      return logprob
  
file_path: PARL/parl/algorithms/fluid/ppo.py
imports: import warnings
  import numpy
  from copy import deepcopy
  from paddle import fluid
  from parl.core.fluid import layers
  from parl.core.fluid.algorithm import Algorithm
label_desc: Use image node_id 2 for calling the PPO obj's underlying member method code with example usage: obj._calc_logprob(actions, means, logvars) and returns: logprob