code: def main(args):
      """Run the main decoding function."""
      parser = get_parser()
      args = parser.parse_args(args)
  
      if args.ngpu == 0 and args.dtype == "float16":
          raise ValueError(
              f"--dtype {args.dtype} does not support the CPU backend."
          )
  
      # logging info
      if args.verbose == 1:
          logging.basicConfig(
              level=logging.INFO,
              format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
          )
      elif args.verbose == 2:
          logging.basicConfig(
              level=logging.DEBUG,
              format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
          )
      else:
          logging.basicConfig(
              level=logging.WARN,
              format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
          )
          logging.warning("Skip DEBUG/INFO messages")
  
      # check CUDA_VISIBLE_DEVICES
      if args.ngpu > 0:
          cvd = os.environ.get("CUDA_VISIBLE_DEVICES")
          if cvd is None:
              logging.warning("CUDA_VISIBLE_DEVICES is not set.")
          elif args.ngpu != len(cvd.split(",")):
              logging.error(
                  "#gpus is not matched with CUDA_VISIBLE_DEVICES."
              )
              sys.exit(1)
  
          # TODO(mn5k): support of multiple GPUs
          if args.ngpu > 1:
              logging.error("The program only supports ngpu=1.")
              sys.exit(1)
  
      # display PYTHONPATH
      logging.info(
          "python path = " + os.environ.get("PYTHONPATH", "(None)")
      )
  
      # seed setting
      random.seed(args.seed)
      np.random.seed(args.seed)
      logging.info("set random seed = %d" % args.seed)
  
      # validate rnn options
      if args.rnnlm is not None and args.word_rnnlm is not None:
          logging.error(
              "It seems that both --rnnlm and --word-rnnlm are specified. "
              "Please use either option."
          )
          sys.exit(1)
  
      # recog
      logging.info("backend = " + args.backend)
      if args.num_spkrs == 1:
          if args.backend == "chainer":
              from espnet.asr.chainer_backend.asr import recog
  
              recog(args)
          elif args.backend == "pytorch":
              if args.num_encs == 1:
                  # Experimental API that supports custom LMs
                  if args.api == "v2":
                      from espnet.asr.pytorch_backend.recog import (
                          recog_v2,
                      )
  
                      recog_v2(args)
                  else:
                      from espnet.asr.pytorch_backend.asr import recog
  
                      if args.dtype != "float32":
                          raise NotImplementedError(
                              f"`--dtype {args.dtype}` is only available with `--api v2`"
                          )
                      recog(args)
              else:
                  if args.api == "v2":
                      raise NotImplementedError(
                          f"--num-encs {args.num_encs} > 1 is not supported in --api v2"
                      )
                  else:
                      from espnet.asr.pytorch_backend.asr import recog
  
                      recog(args)
          else:
              raise ValueError(
                  "Only chainer and pytorch are supported."
              )
      elif args.num_spkrs == 2:
          if args.backend == "pytorch":
              from espnet.asr.pytorch_backend.asr_mix import recog
  
              recog(args)
          else:
              raise ValueError("Only pytorch is supported.")
  
file_path: espnet/espnet/bin/asr_recog.py
imports: import logging
  import os
  import random
  import sys
  import configargparse
  import numpy
  from espnet.utils.cli_utils import strtobool
label_desc: Use image node_id 2 for calling a global function with example usage: main(args) without return types