class_docstr: A class containing all functions for auto-regressive text generation
  
  Pass custom parameter values to 'generate' .
docstr: Decode the id to words
  
  :param tokens: list or a batch of list of ids that indicates the tokens,
          mostly generated by generate
  :return: decoded string
docstr_tok: ["Decode","the","id","to","words",":","param","tokens",":","list","or","a","batch","of","list","of","ids","that","indicates","the","tokens",",","mostly","generated","by","generate",":","return",":","decoded","string"]
code: def batch_decode(
      self, tokens: Union[List[int], List[List[int]]]
  ) -> str:
      """
      Decode the id to words
  
      :param tokens: list or a batch of list of ids that indicates the tokens,
              mostly generated by generate
      :return: decoded string
      """
      is_batched = False
      if tokens is not None and len(tokens) > 0:
          if isinstance(tokens[0], Sequence):
              is_batched = True
          else:
              tokens = [tokens]
      else:
          return None
  
      results = []
      for t in tokens:
          results.append(self.decode(t))
      if not is_batched:
          results = results[0]
      return results
  
imports: from typing import Optional, Union, Sequence, List
  from bigdl.llm.utils.common import invalidInputError
  import torch
label_desc: Use image node_id 3 for calling the GenerationMixin obj's underlying member method code with example usage: obj.batch_decode(tokens) and returns: results, None