code: def __init__(
      self,
      task: str,
      num_class: int = None,
      label_map: Dict = None,
      load_checkpoint: str = None,
      **kwargs,
  ):
      super(PANN, self).__init__()
  
      if label_map:
          self.label_map = label_map
          self.num_class = len(label_map)
      else:
          self.num_class = num_class
  
      if task == "sound-cls":
          self.cnn10 = CNN10(
              extract_embedding=True,
              checkpoint=os.path.join(
                  MODULE_HOME, "panns_cnn10", "cnn10.pdparams"
              ),
          )
          self.dropout = nn.Dropout(0.1)
          self.fc = nn.Linear(self.cnn10.emb_size, num_class)
          self.criterion = paddle.nn.loss.CrossEntropyLoss()
          self.metric = paddle.metric.Accuracy()
      else:
          self.cnn10 = CNN10(
              extract_embedding=False,
              checkpoint=os.path.join(
                  MODULE_HOME, "panns_cnn10", "cnn10.pdparams"
              ),
          )
  
      self.task = task
      if load_checkpoint is not None and os.path.isfile(
          load_checkpoint
      ):
          state_dict = paddle.load(load_checkpoint)
          self.set_state_dict(state_dict)
          logger.info(
              "Loaded parameters from %s"
              % os.path.abspath(load_checkpoint)
          )
  
file_path: PaddleHub/modules/audio/audio_classification/PANNs/cnn10/module.py
imports: import math
  import os
  from typing import Dict
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from panns_cnn10.network import CNN10
  from paddlehub.env import MODULE_HOME
  from paddlehub.module.audio_module import AudioClassifierModule
  from paddlehub.module.module import moduleinfo
  from paddlehub.utils.log import logger
label_desc: Use image node_id 1 to create a new PANN object from inherited base classes: nn with example: obj = PANN(task, num_class, label_map, load_checkpoint)