code: def is_torch_module(model) -> bool:
      """
      判断传入的 ``model`` 是否是 :class:`torch.nn.Module` 类型
  
      :param model: 模型；
      :return: 当前模型是否为 ``torch`` 的模型；
      """
      try:
          return isinstance(model, torch.nn.Module)
      except BaseException:
          return False
  
file_path: fastNLP/fastNLP/core/utils/torch_utils.py
imports: from abc import ABC
  from typing import Any, Union, Optional
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH, _TORCH_GREATER_EQUAL_1_8
  from .utils import apply_to_collection
label_desc: Use image node_id 2 for calling a global function with example usage: is_torch_module(model) and returns: isinstance, False