code: def _create_ft_mat(self, device):
      resnet = models.resnet101(pretrained=True)
      modules = list(resnet.children())[:-1]
      self.model = nn.Sequential(*modules)
      self.model.eval()
  
      kwargs = (
          {"num_workers": 1, "pin_memory": True}
          if device == "cuda"
          else {}
      )
  
      loader = torch.utils.data.DataLoader(
          self.dataset, batch_size=256, shuffle=False, **kwargs
      )
      with torch.no_grad():
          ft_mat = torch.cat(
              [self.model(data[0]).squeeze() for data in loader]
          )
  
      torch.save(ft_mat, self.gen_ft_file)
      del ft_mat
  
      data_mat = torch.cat([data[0].squeeze() for data in loader])
      torch.save(data_mat, self.gen_data_file)
  
      self._load_ft_mat()
  
imports: import io
  import json
  import os
  import pickle
  from collections import Counter, OrderedDict
  from collections import defaultdict
  import numpy
  import torch
  import torch.nn
  from nltk.tokenize import sent_tokenize, word_tokenize
  from torch.utils.data import Dataset
  from torchvision import transforms, models, datasets
label_desc: Use image node_id 6 for calling the CUBImageFt obj's underlying member method code with example usage: obj._create_ft_mat(device) without return types