code: def __replicated_secret_sharing_protocol(op, x, y, *args, **kwargs):
      """Implements bilinear functions using replicated secret shares.
      Shares are input as ArithmeticSharedTensors and are replicated
      within this function to perform computations.
  
      The protocol used here is that of section 3.2 of ABY3
      (https://eprint.iacr.org/2018/403.pdf).
      """
      assert op in {
          "mul",
          "matmul",
          "conv1d",
          "conv2d",
          "conv_transpose1d",
          "conv_transpose2d",
      }
      x_shares, y_shares = replicate_shares([x.share, y.share])
      x1, x2 = x_shares
      y1, y2 = y_shares
  
      z = x.shallow_copy()
      z.share = getattr(torch, op)(x1, y1, *args, **kwargs)
      z.share += getattr(torch, op)(x1, y2, *args, **kwargs)
      z.share += getattr(torch, op)(x2, y1, *args, **kwargs)
  
      return z
  
file_path: CrypTen/crypten/mpc/primitives/replicated.py
imports: import crypten.communicator
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: __replicated_secret_sharing_protocol(op, x, y) and returns: z