code: def update(
      self, observations, actions, rewards, next_observations, terminals
  ):
      with torch.no_grad():
          target_q1, target_q2 = self.q_target.qvalue(
              observations, actions
          )
          target_q = torch.min(target_q1, target_q2)
          next_v = self.model.value(next_observations)
  
      # Update value function
      v = self.model.value(observations)
      adv = target_q - v
      v_loss = asymmetric_l2_loss(adv, self.tau)
  
      # Update Q function
      targets = (
          rewards
          + (1.0 - terminals.float()) * self.discount * next_v.detach()
      )
      q1, q2 = self.model.qvalue(observations, actions)
      qf1_loss = F.mse_loss(q1, targets)
      qf2_loss = F.mse_loss(q2, targets)
      q_loss = qf1_loss + qf2_loss
  
      # Update policy
      exp_adv = torch.exp(self.beta * adv.detach()).clamp(
          max=EXP_ADV_MAX
      )
      policy_out = self.model.policy(observations)
      if isinstance(policy_out, torch.distributions.Distribution):
          bc_losses = -policy_out.log_prob(actions)
      policy_loss = torch.mean((exp_adv[:, 0].detach()) * bc_losses)
  
      self.q_optimizer.zero_grad()
      q_loss.backward()
      self.q_optimizer.step()
  
      self.v_optimizer.zero_grad()
      v_loss.backward()
      self.v_optimizer.step()
  
      self.policy_optimizer.zero_grad()
      policy_loss.backward()
      self.policy_optimizer.step()
  
      # Update target Q network
      self.sync_target(alpha=self.alpha)
  
      return (
          q_loss.cpu().detach(),
          v_loss.cpu().detach(),
          policy_loss.cpu().detach(),
      )
  
file_path: PARL/parl/algorithms/torch/iql.py
imports: import copy
  import torch
  import torch.nn
  import parl
  import torch.nn.functional
  from parl.utils.utils import check_model_method
label_desc: Use image node_id 3 for calling the IQL obj's underlying member method code with example usage: obj.update(observations, actions, rewards, next_observations, terminals) and returns: q_loss,  v_loss,  policy_loss