code: def gram_matrix(data: paddle.Tensor) -> paddle.Tensor:
      """Get gram matrix"""
      b, ch, h, w = data.shape
      features = data.reshape((b, ch, w * h))
      features_t = features.transpose((0, 2, 1))
      gram = features.bmm(features_t) / (ch * h * w)
      return gram
  
imports: import os
  from typing import Callable, Union, List, Tuple
  import cv2
  import paddle
  import PIL
  import numpy
  import paddle.nn.functional
  from scipy.sparse import csr_matrix
label_desc: Use image node_id 8 for calling a global function with example usage: gram_matrix(data) and returns: gram