code: def linear_to_2d(img, size=None):
      if size is not None or (
          hasattr(img, "shape") and len(img.shape) == 1
      ):
          if size is None:
              # make guess for 1-dim tensors
              h = int(math.sqrt(img.shape[0]))
              w = int(img.shape[0] / h)
              size = h, w
          img = np.reshape(img, size)
      return img
  
file_path: tensorwatch/tensorwatch/image_utils.py
imports: import numpy
  import math
  import time
label_desc: Use image node_id 8 for calling a global function with example usage: linear_to_2d(img, size) and returns: img