docstr: 获取 tensor 的 scalar 值
  
  :param tensor: 传入的张量
docstr_tok: ["\u83b7\u53d6","tensor","\u7684","scalar","\u503c",":","param","tensor",":","\u4f20\u5165\u7684\u5f20\u91cf"]
code: def get_scalar(self, tensor) -> float:
      """
      获取 tensor 的 scalar 值
  
      :param tensor: 传入的张量
      """
      return tensor.item()
  
file_path: fastNLP/fastNLP/core/metrics/backend/paddle_backend/backend.py
imports: import os
  from typing import List, Any
  import numpy
  from fastNLP.core.metrics.backend import Backend
  from fastNLP.core.utils.paddle_utils import paddle_to, _convert_data_device, is_in_paddle_dist
  from fastNLP.core.metrics.utils import AggregateMethodError
  from fastNLP.core.drivers.paddle_driver.dist_utils import fastnlp_paddle_all_gather
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE
label_desc: Use image node_id 5 for calling the PaddleBackend obj's underlying member method code with example usage: obj.get_scalar(tensor) and returns: tensor