docstr: Tests get and set classy state methods of meter.
docstr_tok: ["Tests","get","and","set","classy","state","methods","of","meter","."]
code: def meter_get_set_classy_state_test(
      self, meters, model_outputs, targets, expected_value, **kwargs
  ):
      """
      Tests get and set classy state methods of meter.
      """
      assert (
          len(meters) == 2
      ), "Incorrect number of meters passed to test"
      assert (
          len(model_outputs) == 2
      ), "Incorrect number of model_outputs passed to test"
      assert (
          len(targets) == 2
      ), "Incorrect number of targets passed to test"
      meter0 = meters[0]
      meter1 = meters[1]
  
      meter0.update(model_outputs[0], targets[0], **kwargs)
      meter1.update(model_outputs[1], targets[1], **kwargs)
  
      meter0.sync_state()
      value0 = meter0.value
  
      meter1.sync_state()
      value1 = meter1.value
      for key, val in value0.items():
          if torch.is_tensor(value1[key]):
              self.assertFalse(
                  torch.all(torch.eq(value1[key], val)),
                  msg="{0} meter values should not be same!".format(
                      key
                  ),
              )
          else:
              self.assertNotEqual(
                  value1[key],
                  val,
                  msg="{0} meter values should not be same!".format(
                      key
                  ),
              )
  
      meter0.set_classy_state(meter1.get_classy_state())
      value0 = meter0.value
      for key, val in value0.items():
          if torch.is_tensor(value1[key]):
              self.assertTrue(
                  torch.all(torch.eq(value1[key], val)),
                  msg="{0} meter value mismatch after state transfer!".format(
                      key
                  ),
              )
              self.assertTrue(
                  torch.all(torch.eq(value1[key], expected_value[key])),
                  msg="{0} meter value mismatch from ground truth!".format(
                      key
                  ),
              )
          else:
              self.assertAlmostEqual(
                  value1[key],
                  val,
                  places=4,
                  msg="{0} meter value mismatch after state transfer!".format(
                      key
                  ),
              )
              self.assertAlmostEqual(
                  value1[key],
                  expected_value[key],
                  places=4,
                  msg="{0} meter value mismatch from ground truth!".format(
                      key
                  ),
              )
  
imports: import multiprocessing
  import queue
  import tempfile
  import unittest
  import torch
label_desc: Use image node_id 10 for calling the ClassificationMeterTest obj's underlying member method code with example usage: obj.meter_get_set_classy_state_test(meters, model_outputs, targets, expected_value) without return types