code: def _validate_fixedpoint_config(
      config: FixedpointConfig, tensor_factory: AbstractFactory
  ) -> bool:
      """
      Ensure the given FixedpointConfig is compatible with the current
      tensor_factory, preventing silent errors.
      """
      no_issues = True
  
      check_32bit = ceil(log2(config.bound_single_precision)) > 31
      check_64bit = ceil(log2(config.bound_single_precision)) > 63
      trunc_over_mod = ceil(
          log2(config.bound_double_precision)
      ) + config.truncation_gap >= log2(tensor_factory.modulus)
  
      if check_32bit:
          print("WARNING: Plaintext values won't fit in 32bit tensors")
          no_issues = False
  
      if check_64bit:
          print("WARNING: Plaintext values won't fit in 64bit values")
          no_issues = False
  
      if trunc_over_mod:
          print("WARNING: Modulus is too small for truncation")
          no_issues = False
  
      # TODO[Morten] test for intermediate size wrt native type
  
      # TODO[Morten] in decoding we assume that x + bound fits within the native
      #              type of the backing tensor
  
      # TODO[Morten] truncation gap is statistical security for interactive
      #              truncation; write assertions
  
      return no_issues
  
file_path: tf-encrypted/tf_encrypted/tensor/fixed.py
imports: from __future__ import absolute_import
  from math import ceil
  from math import log2
  from .factory import AbstractFactory
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_fixedpoint_config(config, tensor_factory) and returns: no_issues