code: def actor_loss_fn(self, logprobs, old_logprobs, advantages, mask):
      ## policy gradient loss
      log_ratio = (logprobs - old_logprobs) * mask
      ratio = torch.exp(log_ratio)
      pg_loss1 = -advantages * ratio
      pg_loss2 = -advantages * torch.clamp(
          ratio, 1.0 - self.cliprange, 1.0 + self.cliprange
      )
      pg_loss = (
          torch.sum(torch.max(pg_loss1, pg_loss2) * mask) / mask.sum()
      )
      return pg_loss
  
imports: import torch
  import torch.nn.functional
  import time
  import deepspeed
  from deepspeed.runtime.zero.partition_parameters import ZeroParamStatus
  from deepspeed.accelerator import get_accelerator
  from dschat.utils.utils import print_rank_0
label_desc: Use image node_id 7 for calling the DeepSpeedPPOTrainer obj's underlying member method code with example usage: obj.actor_loss_fn(logprobs, old_logprobs, advantages, mask) and returns: pg_loss