code: def rmatmul_f(input, other):
      if not isinstance(input, PHETensor) and isinstance(
          other, PHETensor
      ):
          return matmul(other, input)
  
      if input.ndim > 2 or input.ndim < 1:
          raise ValueError(
              f"can't rmatmul `PHETensor` with `torch.Tensor` with dim `{input.ndim}`"
          )
  
      if isinstance(other, PHETensor):
          raise NotImplementedError(
              f"rmatmul {input} with {other} not supported, phe is not multiplicative homomorphic"
          )
  
      if not isinstance(other, torch.Tensor):
          return NotImplemented
  
      evaluator = input.evaluator
      pk = input.pk
      coder = input.coder
      shape = input.shape
      device = input.device
      other_shape = other.shape
      output_dtype = torch.promote_types(input.dtype, other.dtype)
      output_shape = torch.matmul(
          torch.rand(*other_shape, device="meta"),
          torch.rand(*shape, device="meta"),
      ).shape
      data = evaluator.rmatmul(
          input.data, other, shape, other_shape, pk, coder, output_dtype
      )
      return PHETensor(
          pk, evaluator, coder, output_shape, data, output_dtype, device
      )
  
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 11 for calling a global function with example usage: rmatmul_f(input, other) and returns: PHETensor, matmul, NotImplemented