code: def test_one_hot(self):
      space = gym.spaces.MultiDiscrete([[3, 3], [3, 3]])
  
      # TF
      x = tf.Variable([[0, 2, 1, 0]], dtype=tf.int32)
      y = one_hot_tf(x, space)
      self.assertTrue(
          ([1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0] == y.numpy()).all()
      )
  
      # Torch
      x = torch.tensor([[0, 2, 1, 0]], dtype=torch.int32)
      y = one_hot_torch(x, space)
      self.assertTrue(
          ([1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0] == y.numpy()).all()
      )
  
imports: import gymnasium
  import numpy
  import tree
  import unittest
  import ray
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
  from ray.rllib.utils.numpy import flatten_inputs_to_1d_tensor
  from ray.rllib.utils.numpy import make_action_immutable
  from ray.rllib.utils.test_utils import check
  from ray.rllib.utils.tf_utils import flatten_inputs_to_1d_tensor, l2_loss, one_hot
  from ray.rllib.utils.torch_utils import flatten_inputs_to_1d_tensor, l2_loss, one_hot
label_desc: Use image node_id 6 for calling the TestUtils obj's underlying member method code with example usage: obj.test_one_hot() without return types