class_docstr: Benchmarks runtime and error of crypten functions against PyTorch
  
  Args:
      tensor_size (int or tuple): size of tensor for benchmarking runtimes
class_docstr_tok: ["Benchmarks","runtime","and","error","of","crypten","functions","against","PyTorch","Args",":","tensor_size","(","int","or","tuple",")",":","size","of","tensor","for","benchmarking","runtimes"]
docstr: Invokes func as a method of x
docstr_tok: ["Invokes","func","as","a","method","of","x"]
code: def time_func(x, func, y=None):
      """Invokes func as a method of x"""
      if y is None:
          return getattr(x, func)()
  
      if func in {"conv1d", "conv2d"}:
          if torch.is_tensor(x):
              return getattr(torch.nn.functional, func)(x, y)
          return getattr(x, func)(y)
  
      return getattr(x, func)(y)
  
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 3 for calling the FuncBenchmarks obj's underlying member method code with example usage: obj.time_func(x, func, y) and returns: getattr, getattr, getattr, getattr