class_docstr: 执行评测时使用的 backend，是所有 backend 的父类。Backend 及其子类的所有方法都必须是无状态的。
class_docstr_tok: ["\u6267\u884c\u8bc4\u6d4b\u65f6\u4f7f\u7528\u7684","backend\uff0c\u662f\u6240\u6709","backend","\u7684\u7236\u7c7b\u3002Backend","\u53ca\u5176\u5b50\u7c7b\u7684\u6240\u6709\u65b9\u6cd5\u90fd\u5fc5\u987b\u662f\u65e0\u72b6\u6001\u7684\u3002"]
docstr: 聚集结果，并根据 ``method 计算后`` ，返回结果。
  
  :param tensor: 传入的张量
  :param method: 聚合的方法
docstr_tok: ["\u805a\u96c6\u7ed3\u679c\uff0c\u5e76\u6839\u636e","``","method","\u8ba1\u7b97\u540e","``","\uff0c\u8fd4\u56de\u7ed3\u679c\u3002",":","param","tensor",":","\u4f20\u5165\u7684\u5f20\u91cf",":","param","method",":","\u805a\u5408\u7684\u65b9\u6cd5"]
code: def aggregate(self, tensor, method: str):
      """
      聚集结果，并根据 ``method 计算后`` ，返回结果。
  
      :param tensor: 传入的张量
      :param method: 聚合的方法
      """
      if method is not None:
          return AggregateMethodError(
              should_have_aggregate_method=False, only_warn=True
          )
  
      return tensor
  
file_path: fastNLP/fastNLP/core/metrics/backend/backend.py
imports: from ..utils import AggregateMethodError
label_desc: Use image node_id 2 for calling the Backend obj's underlying member method code with example usage: obj.aggregate(tensor, method) and returns: tensor, AggregateMethodError