docstr: Test multi-device aggregation of weights.
docstr_tok: ["Test","multi-device","aggregation","of","weights","."]
code: def test_accelerated_weighted_category_accuracy(self):
      """Test multi-device aggregation of weights."""
      layer = tl.Accelerate(tl.WeightedCategoryAccuracy())
      weights = np.array([1.0, 1.0, 1.0, 0.0])
      targets = np.array([0, 1, 2, 3])
  
      model_outputs = np.array(
          [
              [0.2, 0.1, 0.7, 0.0],
              [0.2, 0.1, 0.7, 0.0],
              [0.2, 0.1, 0.7, 0.0],
              [0.2, 0.1, 0.7, 0.0],
          ]
      )
      accuracy = layer([model_outputs, targets, weights])
      self.assertEqual(np.mean(accuracy), 1 / 3)
  
file_path: trax/trax/layers/acceleration_test.py
imports: from absl.testing import absltest
  from jax import config
  import numpy
  from trax import fastmath
  from trax import layers
  from trax import shapes
label_desc: Use image node_id 3 for calling the AccelerationTest obj's underlying member method code with example usage: obj.test_accelerated_weighted_category_accuracy() without return types