code: def load_feat(feat_path: str, convert_to_tensor: bool = False) -> Any:
      with PathManager.open(feat_path, "rb") as f:
          if feat_path.endswith("npy"):
              feat = np.load(f, allow_pickle=True)
              if convert_to_tensor:
                  feat = torch.from_numpy(feat)
          elif feat_path.endswith("pth"):
              feat = torch.load(f, map_location=torch.device("cpu"))
          else:
              raise AssertionError("Unknown feature type")
  
      return feat
  
imports: import math
  import os
  import pickle
  from typing import Any
  import lmdb
  import numpy
  import torch
  from mmf.utils.file_io import PathManager
label_desc: Use image node_id 1 for calling a global function with example usage: load_feat(feat_path, convert_to_tensor) and returns: feat