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: Call plain text and CrypTen function on given function
  Uses DOMAIN, TRUNCATED_DOMAIN, or appropriate layer inputs
  
  Returns: tuple of (plain text result, encrypted result)
docstr_tok: ["Call","plain","text","and","CrypTen","function","on","given","function","Uses","DOMAIN",",","TRUNCATED_DOMAIN",",","or","appropriate","layer","inputs","Returns",":","tuple","of","(","plain","text","result",",","encrypted","result",")"]
code: def call_function_on_domain(self, func):
      """Call plain text and CrypTen function on given function
      Uses DOMAIN, TRUNCATED_DOMAIN, or appropriate layer inputs
  
      Returns: tuple of (plain text result, encrypted result)
      """
      DOMAIN, TRUNCATED_DOMAIN = (
          FuncBenchmarks.DOMAIN,
          FuncBenchmarks.TRUNCATED_DOMAIN,
      )
      if hasattr(DOMAIN, "to") and hasattr(TRUNCATED_DOMAIN, "to"):
          DOMAIN, TRUNCATED_DOMAIN = (
              DOMAIN.to(device=self.device),
              TRUNCATED_DOMAIN.to(device=self.device),
          )
      y = torch.rand(DOMAIN.shape, device=self.device)
      DOMAIN_enc, y_enc = crypten.cryptensor(
          DOMAIN
      ), crypten.cryptensor(y)
      TRUNCATED_DOMAIN_enc = crypten.cryptensor(TRUNCATED_DOMAIN)
  
      if func in ["exp", "cos", "sin"]:
          ref, out_enc = (
              getattr(TRUNCATED_DOMAIN, func)(),
              getattr(TRUNCATED_DOMAIN_enc, func)(),
          )
      elif func in FuncBenchmarks.UNARY:
          ref, out_enc = (
              getattr(DOMAIN, func)(),
              getattr(DOMAIN_enc, func)(),
          )
      elif func in FuncBenchmarks.LAYERS:
          ref, out_enc = self._call_layer(func)
      elif func in FuncBenchmarks.BINARY:
          ref, out_enc = (
              getattr(DOMAIN, func)(y),
              getattr(DOMAIN_enc, func)(y_enc),
          )
      else:
          raise ValueError(f"{func} not supported")
  
      return ref, out_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 10 for calling the FuncBenchmarks obj's underlying member method code with example usage: obj.call_function_on_domain(func) and returns: ref,  out_enc