class_docstr: A field that conducts tokenization and numericalization over each token rather the sequence.
  
  This is customized for models requiring character/subword-level inputs, e.g., CharLSTM and BERT.
  
  Args:
      fix_len (int):
          A fixed length that all subword pieces will be padded to.
          This is used for truncating the subword pieces that exceed the length.
          To save the memory, the final length will be the smaller value
          between the max length of subword pieces in a batch and `fix_len`.
  
  Examples:
      >>> from transformers import AutoTokenizer
      >>> tokenizer = AutoTokenizer.from_pretrained('bert-base-cased')
      >>> field = SubwordField('bert',
                               pad=tokenizer.pad_token,
                               unk=tokenizer.unk_token,
                               bos=tokenizer.cls_token,
                               eos=tokenizer.sep_token,
                               fix_len=20,
                               tokenize=tokenizer.tokenize)
      >>> field.vocab = tokenizer.get_vocab()  # no need to re-build the vocab
      >>> field.transform([['This', 'field', 'performs', 'token-level', 'tokenization']])[0]
      tensor([[  101,     0,     0],
              [ 1188,     0,     0],
              [ 1768,     0,     0],
              [10383,     0,     0],
              [22559,   118,  1634],
              [22559,  2734,     0],
              [  102,     0,     0]])
class_docstr_tok: ["A","field","that","conducts","tokenization","and","numericalization","over","each","token","rather","the","sequence",".","This","is","customized","for","models","requiring","character\/subword-level","inputs",",","e.g.",",","CharLSTM","and","BERT",".","Args",":","fix_len","(","int",")",":","A","fixed","length","that","all","subword","pieces","will","be","padded","to",".","This","is","used","for","truncating","the","subword","pieces","that","exceed","the","length",".","To","save","the","memory",",","the","final","length","will","be","the","smaller","value","between","the","max","length","of","subword","pieces","in","a","batch","and","`","fix_len","`",".","Examples",":",">",">",">","from","transformers","import","AutoTokenizer",">",">",">","tokenizer","=","AutoTokenizer.from_pretrained","(","'bert-base-cased","'",")",">",">",">","field","=","SubwordField","(","'bert","'",",","pad=tokenizer.pad_token",",","unk=tokenizer.unk_token",",","bos=tokenizer.cls_token",",","eos=tokenizer.sep_token",",","fix_len=20",",","tokenize=tokenizer.tokenize",")",">",">",">","field.vocab","=","tokenizer.get_vocab","(",")","#","no","need","to","re-build","the","vocab",">",">",">","field.transform","(","[","[","'This","'",",","'field","'",",","'performs","'",",","'token-level","'",",","'tokenization","'","]","]",")","[","0","]","tensor","(","[","[","101",",","0",",","0","]",",","[","1188",",","0",",","0","]",",","[","1768",",","0",",","0","]",",","[","10383",",","0",",","0","]",",","[","22559",",","118",",","1634","]",",","[","22559",",","2734",",","0","]",",","[","102",",","0",",","0","]","]",")"]
code: def __init__(self, *args, **kwargs):
      self.fix_len = kwargs.pop("fix_len") if "fix_len" in kwargs else 0
      super().__init__(*args, **kwargs)
  
imports: from collections import Counter
  import torch
  from underthesea.utils.sp_fn import pad
  from underthesea.utils.sp_vocab import Vocab
label_desc: Use image node_id 1 to create a new SubwordField object from inherited base classes: Field with example: obj = SubwordField()