code: def test_compute_advantage(self):
      sample_actions = torch.as_tensor(
          np.random.randint(self.action_size, size=self.batch_size)
      )
      greedy_actions = self.q_values.argmax(axis=1)
      ret = self.qout.compute_advantage(sample_actions)
      self.assertIsInstance(ret, torch.Tensor)
      for b in range(self.batch_size):
          if sample_actions[b] == greedy_actions[b]:
              self.assertAlmostEqual(
                  ret.detach().cpu().numpy()[b], 0, places=5
              )
          else:
              # An advantage to the optimal policy must be always negative
              self.assertLess(ret.detach().cpu().numpy()[b], 0)
              q = self.q_values[b, sample_actions[b]]
              v = self.q_values[b, greedy_actions[b]]
              adv = q - v
              self.assertAlmostEqual(
                  ret.detach().cpu().numpy()[b], adv, places=5
              )
  
imports: import unittest
  import numpy
  import pytest
  import torch
  from pfrl import action_value
  from pfrl.testing import torch_assert_allclose
label_desc: Use image node_id 7 for calling the TestDistributionalDiscreteActionValue obj's underlying member method code with example usage: obj.test_compute_advantage() without return types