class_docstr: 经过处理的数据信息，包括一系列数据集（比如：分开的训练集、验证集和测试集）以及各个 field 对应的 vocabulary。该对象一般由
  **fastNLP** 中各种 :class:`~fastNLP.io.loader.Loader` 的 :meth:`load` 函数生成，可以通过以下的方法获取里面的内容::
  
      data_bundle = YelpLoader().load({'train':'/path/to/train', 'dev': '/path/to/dev'})
      train_vocabs = data_bundle.vocabs['train']
      train_data = data_bundle.datasets['train']
      dev_data = data_bundle.datasets['train']
  
  :param vocabs: 从名称（字符串）到 :class:`~fastNLP.core.Vocabulary` 类型的字典
  :param datasets: 从名称（字符串）到 :class:`~fastNLP.core.dataset.DataSet` 类型的字典。建议不要将相同的 ``DataSet`` 对象重复传入，
      否则可能会在使用 :class:`~fastNLP.io.pipe.Pipe` 处理数据的时候遇到问题，若多个数据集确需一致，请手动 ``deepcopy`` 后传入。
docstr: 如果需要对某个 field 的内容进行特殊的调整，请使用这个函数。
  
  :param field_name: 需要调整的 field 的名称。如果 :meth:`Dataset.__getitem__` 方法返回的是字典类型，则可以直接使用对应的
      field 的 key 来表示，如果是嵌套字典，可以使用元组表示多层次的 key，例如 ``{'a': {'b': 1}}`` 中可以使用 ``('a', 'b')``;
      如果 :meth:`Dataset.__getitem__` 返回的是 Sequence 类型，则可以使用 ``'_0'``, ``'_1'`` 表示序列中第 **0** 或 **1** 个元素。
      如果该 field 在数据中没有找到，则报错；如果 :meth:`Dataset.__getitem__` 返回的是就是整体内容，请使用 "_single" 。
  :param pad_val: 这个 field 的默认 pad 值。如果设置为 ``None``，则表示该 field 不需要 pad , fastNLP 默认只会对可以 pad 的
      field 进行 pad，所以如果对应 field 本身就不是可以 pad 的形式，可以不需要主动设置为 ``None`` 。如果 ``backend`` 为 ``None``，
      该值无意义。
  :param dtype: 对于需要 pad 的 field ，该 field 数据的 ``dtype`` 。
  :param backend: 可选 ``['raw', 'numpy', 'torch', 'paddle', 'jittor', 'oneflow', 'auto']`` ，分别代表，输出为 :class:`list`, 
      :class:`numpy.ndarray`, :class:`torch.Tensor`, :class:`paddle.Tensor`, :class:`jittor.Var`, :class:`oneflow.Tensor` 类型。
      若 ``pad_val`` 为 ``None`` ，该值无意义 。
  :param pad_fn: 指定当前 field 的 pad 函数，传入该函数则 ``pad_val``, ``dtype``, ``backend`` 等参数失效。``pad_fn`` 的输入为当前 field 的
      batch 形式。 Collator 将自动 unbatch 数据，然后将各个 field 组成各自的 batch 。
  :return: self
docstr_tok: ["\u5982\u679c\u9700\u8981\u5bf9\u67d0\u4e2a","field","\u7684\u5185\u5bb9\u8fdb\u884c\u7279\u6b8a\u7684\u8c03\u6574\uff0c\u8bf7\u4f7f\u7528\u8fd9\u4e2a\u51fd\u6570\u3002",":","param","field_name",":","\u9700\u8981\u8c03\u6574\u7684","field","\u7684\u540d\u79f0\u3002\u5982\u679c",":","meth",":","`","Dataset.__getitem__","`","\u65b9\u6cd5\u8fd4\u56de\u7684\u662f\u5b57\u5178\u7c7b\u578b\uff0c\u5219\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u5bf9\u5e94\u7684","field","\u7684","key","\u6765\u8868\u793a\uff0c\u5982\u679c\u662f\u5d4c\u5957\u5b57\u5178\uff0c\u53ef\u4ee5\u4f7f\u7528\u5143\u7ec4\u8868\u793a\u591a\u5c42\u6b21\u7684","key\uff0c\u4f8b\u5982","``","{","'","a","'",":","{","'","b","'",":","1","}","}","``","\u4e2d\u53ef\u4ee5\u4f7f\u7528","``","(","'","a","'",",","'","b","'",")","``",";","\u5982\u679c",":","meth",":","`","Dataset.__getitem__","`","\u8fd4\u56de\u7684\u662f","Sequence","\u7c7b\u578b\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528","``","'_0","'","``",",","``","'_1","'","``","\u8868\u793a\u5e8f\u5217\u4e2d\u7b2c","*","*","0","*","*","\u6216","*","*","1","*","*","\u4e2a\u5143\u7d20\u3002","\u5982\u679c\u8be5","field","\u5728\u6570\u636e\u4e2d\u6ca1\u6709\u627e\u5230\uff0c\u5219\u62a5\u9519\uff1b\u5982\u679c",":","meth",":","`","Dataset.__getitem__","`","\u8fd4\u56de\u7684\u662f\u5c31\u662f\u6574\u4f53\u5185\u5bb9\uff0c\u8bf7\u4f7f\u7528","``","_single","''","\u3002",":","param","pad_val",":","\u8fd9\u4e2a","field","\u7684\u9ed8\u8ba4","pad","\u503c\u3002\u5982\u679c\u8bbe\u7f6e\u4e3a","``","None","``","\uff0c\u5219\u8868\u793a\u8be5","field","\u4e0d\u9700\u8981","pad",",","fastNLP","\u9ed8\u8ba4\u53ea\u4f1a\u5bf9\u53ef\u4ee5","pad","\u7684","field","\u8fdb\u884c","pad\uff0c\u6240\u4ee5\u5982\u679c\u5bf9\u5e94","field","\u672c\u8eab\u5c31\u4e0d\u662f\u53ef\u4ee5","pad","\u7684\u5f62\u5f0f\uff0c\u53ef\u4ee5\u4e0d\u9700\u8981\u4e3b\u52a8\u8bbe\u7f6e\u4e3a","``","None","``","\u3002\u5982\u679c","``","backend","``","\u4e3a","``","None","``","\uff0c","\u8be5\u503c\u65e0\u610f\u4e49\u3002",":","param","dtype",":","\u5bf9\u4e8e\u9700\u8981","pad","\u7684","field","\uff0c\u8be5","field","\u6570\u636e\u7684","``","dtype","``","\u3002",":","param","backend",":","\u53ef\u9009","``","[","'raw","'",",","'numpy","'",",","'torch","'",",","'paddle","'",",","'jittor","'",",","'oneflow","'",",","'auto","'","]","``","\uff0c\u5206\u522b\u4ee3\u8868\uff0c\u8f93\u51fa\u4e3a",":","class",":","`","list","`",",",":","class",":","`","numpy.ndarray","`",",",":","class",":","`","torch.Tensor","`",",",":","class",":","`","paddle.Tensor","`",",",":","class",":","`","jittor.Var","`",",",":","class",":","`","oneflow.Tensor","`","\u7c7b\u578b\u3002","\u82e5","``","pad_val","``","\u4e3a","``","None","``","\uff0c\u8be5\u503c\u65e0\u610f\u4e49","\u3002",":","param","pad_fn",":","\u6307\u5b9a\u5f53\u524d","field","\u7684","pad","\u51fd\u6570\uff0c\u4f20\u5165\u8be5\u51fd\u6570\u5219","``","pad_val","``",",","``","dtype","``",",","``","backend","``","\u7b49\u53c2\u6570\u5931\u6548\u3002","``","pad_fn","``","\u7684\u8f93\u5165\u4e3a\u5f53\u524d","field","\u7684","batch","\u5f62\u5f0f\u3002","Collator","\u5c06\u81ea\u52a8","unbatch","\u6570\u636e\uff0c\u7136\u540e\u5c06\u5404\u4e2a","field","\u7ec4\u6210\u5404\u81ea\u7684","batch","\u3002",":","return",":","self"]
code: def set_pad(
      self, field_name, pad_val=0, dtype=None, backend=None, pad_fn=None
  ) -> "DataBundle":
      """
      如果需要对某个 field 的内容进行特殊的调整，请使用这个函数。
  
      :param field_name: 需要调整的 field 的名称。如果 :meth:`Dataset.__getitem__` 方法返回的是字典类型，则可以直接使用对应的
          field 的 key 来表示，如果是嵌套字典，可以使用元组表示多层次的 key，例如 ``{'a': {'b': 1}}`` 中可以使用 ``('a', 'b')``;
          如果 :meth:`Dataset.__getitem__` 返回的是 Sequence 类型，则可以使用 ``'_0'``, ``'_1'`` 表示序列中第 **0** 或 **1** 个元素。
          如果该 field 在数据中没有找到，则报错；如果 :meth:`Dataset.__getitem__` 返回的是就是整体内容，请使用 "_single" 。
      :param pad_val: 这个 field 的默认 pad 值。如果设置为 ``None``，则表示该 field 不需要 pad , fastNLP 默认只会对可以 pad 的
          field 进行 pad，所以如果对应 field 本身就不是可以 pad 的形式，可以不需要主动设置为 ``None`` 。如果 ``backend`` 为 ``None``，
          该值无意义。
      :param dtype: 对于需要 pad 的 field ，该 field 数据的 ``dtype`` 。
      :param backend: 可选 ``['raw', 'numpy', 'torch', 'paddle', 'jittor', 'oneflow', 'auto']`` ，分别代表，输出为 :class:`list`,
          :class:`numpy.ndarray`, :class:`torch.Tensor`, :class:`paddle.Tensor`, :class:`jittor.Var`, :class:`oneflow.Tensor` 类型。
          若 ``pad_val`` 为 ``None`` ，该值无意义 。
      :param pad_fn: 指定当前 field 的 pad 函数，传入该函数则 ``pad_val``, ``dtype``, ``backend`` 等参数失效。``pad_fn`` 的输入为当前 field 的
          batch 形式。 Collator 将自动 unbatch 数据，然后将各个 field 组成各自的 batch 。
      :return: self
      """
      for _, ds in self.iter_datasets():
          ds.collator.set_pad(
              field_name=field_name,
              pad_val=pad_val,
              dtype=dtype,
              backend=backend,
              pad_fn=pad_fn,
          )
      return self
  
imports: from typing import Union, List, Callable, Dict
  from ..core.dataset import DataSet
  from fastNLP.core.vocabulary import Vocabulary
  from fastNLP.core import logger
label_desc: Use image node_id 25 for calling the DataBundle obj's underlying member method code with example usage: obj.set_pad(field_name, pad_val, dtype, backend, pad_fn) and returns: self