class_docstr: Encoder that encodes long or float tensors into scaled integer tensors.
code: def __setattr__(self, name, value):
      if name == "_precision_bits":
          dict.__setattr__(self, "_scale", int(2**value))
      elif name == "_scale":
          dict.__setattr__(
              self, "_precision_bits", int(math.log2(value))
          )
      dict.__setattr__(self, name, value)
  
file_path: FATE/python/fate/arch/protocol/mpc/encoder.py
imports: import math
  import numpy
  import torch
  from fate.arch.tensor import DTensor
  from .common.tensor_types import is_float_tensor, is_int_tensor
  from .config import cfg
  from .cryptensor import CrypTensor
label_desc: Use image node_id 4 for calling the FixedPointEncoder obj's underlying member method code with example usage: obj.__setattr__(name, value) without return types