code: def rsub(input, other):
      if not isinstance(input, PHETensor) and isinstance(
          other, PHETensor
      ):
          return sub(other, input)
  
      evaluator = input.evaluator
      pk = input.pk
      coder = input.coder
      shape = input.shape
      dtype = input.dtype
      if isinstance(other, PHETensor):
          assert (
              shape == other.shape
          ), f"shape mismatch {shape} != {other.shape}"
          output_dtype = torch.promote_types(dtype, other.dtype)
          data = evaluator.rsub(input.data, other.data, pk)
          return input.with_template(data, dtype=output_dtype)
  
      elif isinstance(other, torch.Tensor):
          if shape == other.shape:
              output_dtype = torch.promote_types(dtype, other.dtype)
              data = evaluator.rsub_plain(
                  input.data, other, pk, coder, output_dtype
              )
              return input.with_template(data, dtype=output_dtype)
          elif other.ndim == 0:
              output_dtype = torch.promote_types(dtype, other.dtype)
              data = evaluator.rsub_plain_scalar(
                  input.data,
                  other.detach().item(),
                  pk,
                  coder,
                  output_dtype,
              )
              return input.with_template(data, dtype=output_dtype)
          else:
              raise NotImplementedError(f"broadcast not supported")
  
      elif isinstance(other, (float, int)):
          output_dtype = torch.promote_types(
              dtype, torch.get_default_dtype()
          )
          data = evaluator.rsub_plain_scalar(
              input.data, other, pk, coder, output_dtype
          )
          return input.with_template(data, dtype=output_dtype)
  
      else:
          return NotImplemented
  
file_path: FATE/python/fate/arch/tensor/phe/_ops.py
imports: import torch
  from fate.arch.tensor import _custom_ops
  from ._tensor import PHETensor, implements, implements_encoded
label_desc: Use image node_id 8 for calling a global function with example usage: rsub(input, other) and returns: sub, input, input, input, NotImplemented, input