code: def test_sample(self):
      # check shape
      sample_action = self.dist.sample()
      self.assertTrue(
          sample_action.shape == (self.batch_size, self.num_actions)
      )
      # check range of softmax output
      self.assertTrue(
          torch.max(sample_action) <= 1
          and torch.min(sample_action) >= 0
      )
  
imports: import random
  import copy
  import numpy
  import torch
  import unittest
  from parl.core.torch.policy_distribution import DiagGaussianDistribution, CategoricalDistribution, SoftCategoricalDistribution, SoftMultiCategoricalDistribution
label_desc: Use image node_id 3 for calling the SoftCategoricalDistributionTest obj's underlying member method code with example usage: obj.test_sample() without return types