class_docstr: Meter to calculate mean AP metric for multi-label image classification task.
  
  Args:
      meters_config (AttrDict): config containing the meter settings
  
  meters_config should specify the num_classes
class_docstr_tok: ["Meter","to","calculate","mean","AP","metric","for","multi-label","image","classification","task",".","Args",":","meters_config","(","AttrDict",")",":","config","containing","the","meter","settings","meters_config","should","specify","the","num_classes"]
docstr: Validate that the input to meter is valid
docstr_tok: ["Validate","that","the","input","to","meter","is","valid"]
code: def validate(self, model_output, target):
      """
      Validate that the input to meter is valid
      """
      assert (
          len(model_output.shape) == 2
      ), "model_output should be a 2D tensor"
      assert len(target.shape) == 2, "target should be a 2D tensor"
      assert (
          model_output.shape[0] == target.shape[0]
      ), "Expect same shape in model output and target"
      assert (
          model_output.shape[1] == target.shape[1]
      ), "Expect same shape in model output and target"
      num_classes = target.shape[1]
      assert (
          num_classes == self.num_classes
      ), "number of classes is not consistent"
  
imports: import logging
  import numpy
  import torch
  from classy_vision.generic.distributed_util import all_reduce_sum, gather_from_all
  from classy_vision.meters import ClassyMeter, register_meter
  from vissl.config import AttrDict
  from vissl.utils.env import get_machine_local_and_dist_rank
  from vissl.utils.svm_utils.evaluate import get_precision_recall
label_desc: Use image node_id 14 for calling the MeanAPMeter obj's underlying member method code with example usage: obj.validate(model_output, target) without return types