code: def test_weighted_nd(self):
      sum_obj = reduction_metrics.Sum(name="sum", dtype="float32")
      sum_obj.update_state(
          [[1, 3], [5, 7]], sample_weight=[[1, 1], [1, 0]]
      )
      result = sum_obj.result()
      self.assertAllClose(result, 9.0, atol=1e-3)
  
imports: import numpy
  from keras import testing
  from keras.metrics import reduction_metrics
  from keras.saving import register_keras_serializable
label_desc: Use image node_id 4 for calling the SumTest obj's underlying member method code with example usage: obj.test_weighted_nd() without return types