code: def smoothness_prox(tensor, regularizer):
      """Proximal operator for smoothness
  
      Parameters
      ----------
      tensor : ndarray
      regularizer : float
  
      Returns
      -------
      ndarray
  
      """
      diag_matrix = (
          tl.diag(2 * regularizer * tl.ones(tl.shape(tensor)[0]) + 1)
          + tl.diag(
              -regularizer * tl.ones(tl.shape(tensor)[0] - 1), k=-1
          )
          + tl.diag(
              -regularizer * tl.ones(tl.shape(tensor)[0] - 1), k=1
          )
      )
      return tl.solve(diag_matrix, tensor)
  
file_path: tensorly/tensorly/tenalg/proximal.py
imports: import tensorly
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: smoothness_prox(tensor, regularizer) and returns: tl