code: def test_get_model_actions_randomize(self):
      scores = torch.tensor(
          [
              [1, 20, 20],
              [4, 4, 3],
              [15, 10, 15],
              [100, float("inf"), float("inf")],
          ]
      )
      mask = torch.tensor([[1, 1, 0], [0, 0, 1], [1, 0, 1], [1, 0, 1]])
      argmax_values_returned = {0: set(), 1: set(), 2: set(), 3: set()}
      for _ in range(1000):
          # repeat many times since the function is stochastic
          argmax = get_model_actions(scores, mask, randomize_ties=True)
          # make sure argmax returns one of the max element indices
          argmax_values_returned[0].add(argmax[0].item())
          argmax_values_returned[1].add(argmax[1].item())
          argmax_values_returned[2].add(argmax[2].item())
          argmax_values_returned[3].add(argmax[3].item())
      self.assertSetEqual(
          argmax_values_returned[0],
          {
              1,
          },
      )
      self.assertSetEqual(
          argmax_values_returned[1],
          {
              2,
          },
      )
      self.assertSetEqual(argmax_values_returned[2], {0, 2})
      self.assertSetEqual(
          argmax_values_returned[3],
          {
              2,
          },
      )
  
file_path: ReAgent/reagent/test/training/cb/test_utils.py
imports: import unittest
  import numpy
  import torch
  from numpy import testing
  from reagent.core.types import CBInput
  from reagent.training.cb.utils import add_chosen_arm_features, argmax_random_tie_breaks, get_model_actions
label_desc: Use image node_id 4 for calling the TestCButils obj's underlying member method code with example usage: obj.test_get_model_actions_randomize() without return types