class_docstr: 用于维护处于 topk 的 key, value 对。
  
  :param int topk: 整数，-1 表示所有数据都是 topk 的; 如果是 0, 表示没有任何数据是满足 topk 的。
class_docstr_tok: ["\u7528\u4e8e\u7ef4\u62a4\u5904\u4e8e","topk","\u7684","key",",","value","\u5bf9\u3002",":","param","int","topk",":","\u6574\u6570\uff0c-1","\u8868\u793a\u6240\u6709\u6570\u636e\u90fd\u662f","topk","\u7684",";","\u5982\u679c\u662f","0",",","\u8868\u793a\u6ca1\u6709\u4efb\u4f55\u6570\u636e\u662f\u6ee1\u8db3","topk","\u7684\u3002"]
code: def __bool__(self):
      # 当 topk 为 0 时，表明该 topk_queue 无意义。
      return self.topk != 0
  
imports: import json
  import os
  from copy import deepcopy
  from pathlib import Path
  from typing import Optional, Dict, Tuple, Callable, Union
  from ...envs.distributed import rank_zero_rm
  from fastNLP.core.log import logger
  from fastNLP.envs import FASTNLP_LAUNCH_TIME
  from fastNLP.envs import rank_zero_call
  from fastNLP.envs.env import FASTNLP_EVALUATE_RESULT_FILENAME
  from .has_monitor_callback import ResultsMonitor
label_desc: Use image node_id 6 for calling the TopkQueue obj's underlying member method code with example usage: obj.__bool__() and returns: unknown