code: def features_to_dataset(features):
      """
      :param features: list InputFeatures
      :return: TensorDataset
      """
      all_input_ids = torch.tensor(
          [f.input_ids for f in features], dtype=torch.long
      )
      all_input_mask = torch.tensor(
          [f.input_mask for f in features], dtype=torch.long
      )
      all_segment_ids = torch.tensor(
          [f.segment_ids for f in features], dtype=torch.long
      )
      all_label_ids = torch.tensor(
          [f.label_ids for f in features], dtype=torch.long
      )
  
      dataset = TensorDataset(
          all_input_ids, all_input_mask, all_segment_ids, all_label_ids
      )
      return dataset
  
imports: from __future__ import print_function, unicode_literals
  import random
  from contextlib import closing
  from multiprocessing import Pool
  import numpy
  import pandas
  import torch
  from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset, random_split
  from torchtext.legacy import data
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: features_to_dataset(features) and returns: dataset