class_docstr: Index Dense Embeddings.
class_docstr_tok: ["Index","Dense","Embeddings","."]
docstr: Index data.
  
  :param input_files:
      files to load.
docstr_tok: ["Index","data",".",":","param","input_files",":","files","to","load","."]
code: def index_data(self, input_files: List[str], add_only: bool = False):
      """
      Index data.
  
      :param input_files:
          files to load.
      """
      all_docs = []
      for in_file in input_files:
          logging.info(f"Reading file {in_file}")
          docs = torch.load(in_file)
          if isinstance(docs, list):
              all_docs += docs
          else:
              all_docs.append(docs)
  
      self.index.index_data(all_docs)
  
file_path: ParlAI/parlai/agents/rag/scripts/index_dense_embeddings.py
imports: import os
  import random
  import torch
  from typing import List
  from parlai.core.params import ParlaiParser
  from parlai.core.script import ParlaiScript
  import parlai.utils.logging
  from parlai.agents.rag.rag import RagAgent
  from parlai.agents.rag.indexers import indexer_factory, CompressedIndexer
label_desc: Use image node_id 3 for calling the Indexer obj's underlying member method code with example usage: obj.index_data(input_files, add_only) without return types