code: def __init__(self, tensor):
      self.floating_dtype = "float" in str(repr(tensor.dtype))
      self.int_mode = True
      self.sci_mode = False
      self.max_width = 1
  
      tensor_view = tensor.reshape(-1)
  
      if not self.floating_dtype:
          for value in tensor_view:
              value_str = "{}".format(value)
              # d = max(self.max_width, len(value_str))
              d = max(2, len(value_str))
              self.max_width = d
  
      else:
          # FLOATING POINT
  
          for value in tensor_view:
              if value != np.ceil(value):
                  self.int_mode = False
                  break
  
          if self.int_mode:
              for value in tensor_view:
                  value_str = ("{:.0f}").format(value)
                  self.max_width = max(
                      self.max_width, len(value_str) + 1
                  )
  
      if PRINT_OPTS.sci_mode is not None:
          self.sci_mode = PRINT_OPTS.sci_mode
  
file_path: caer/caer/coreten/_tensor_str.py
imports: import math
  import numpy
label_desc: Use image node_id 1 to create a new _Formatter object from inherited base classes: object with example: obj = _Formatter(tensor)