class_docstr: Encoder that encodes long or float tensors into scaled integer tensors.
class_docstr_tok: ["Encoder","that","encodes","long","or","float","tensors","into","scaled","integer","tensors","."]
docstr: Helper function that decodes from scaled tensor
docstr_tok: ["Helper","function","that","decodes","from","scaled","tensor"]
code: def decode(self, tensor):
      """Helper function that decodes from scaled tensor"""
      if tensor is None:
          return None
      assert is_int_tensor(tensor), "input must be a LongTensor"
      if self._scale > 1:
          correction = (tensor < 0).long()
          dividend = tensor.div(
              self._scale - correction, rounding_mode="floor"
          )
          remainder = tensor % self._scale
          remainder += (
              (remainder == 0).long() * self._scale * correction
          )
  
          tensor = dividend.float() + remainder.float() / self._scale
      else:
          tensor = nearest_integer_division(tensor, self._scale)
  
      return tensor.data
  
file_path: CrypTen/crypten/encoder.py
imports: import math
  import numpy
  import torch
  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 3 for calling the FixedPointEncoder obj's underlying member method code with example usage: obj.decode(tensor) and returns: tensor, None