class_docstr: Benchmarks runtime and accuracy of crypten models
  
  Models are benchmarked on synthetically generated
  Gaussian clusters for binary classification. Resnet18 is
  benchmarks use image data.
  
  Args:
      n_samples (int): number of samples for Gaussian cluster model training
      n_features (int): number of features for the Gaussian clusters.
      epochs (int): number of training epochs
      lr_rate (float): learning rate.
class_docstr_tok: ["Benchmarks","runtime","and","accuracy","of","crypten","models","Models","are","benchmarked","on","synthetically","generated","Gaussian","clusters","for","binary","classification",".","Resnet18","is","benchmarks","use","image","data",".","Args",":","n_samples","(","int",")",":","number","of","samples","for","Gaussian","cluster","model","training","n_features","(","int",")",":","number","of","features","for","the","Gaussian","clusters",".","epochs","(","int",")",":","number","of","training","epochs","lr_rate","(","float",")",":","learning","rate","."]
docstr: Returns inference time for plain text and CrypTen
docstr_tok: ["Returns","inference","time","for","plain","text","and","CrypTen"]
code: def time_inference(self):
      """Returns inference time for plain text and CrypTen"""
      runtimes = []
      runtimes_enc = []
  
      for model in self.models:
          x = model.data.x.to(self.device)
          model_plain = model.plain
          if hasattr(model_plain, "to"):
              model_plain = model_plain.to(self.device)
          runtime, _ = self.predict(model_plain, x)
          runtimes.append(runtime)
  
          model_crypten = model.crypten
          if hasattr(model_crypten, "to"):
              model_crypten = model_crypten.to(self.device)
          model_enc = model_crypten.encrypt()
  
          x_enc = crypten.cryptensor(x)
          runtime_enc, _ = self.predict(model_enc, x_enc)
          runtimes_enc.append(runtime_enc)
  
      return runtimes, runtimes_enc
  
imports: import argparse
  import functools
  import os
  import timeit
  from collections import namedtuple
  import crypten
  import crypten.communicator
  import numpy
  import pandas
  import torch
  from examples import multiprocess_launcher
label_desc: Use image node_id 8 for calling the ModelBenchmarks obj's underlying member method code with example usage: obj.time_inference() and returns: runtimes,  runtimes_enc