class_docstr: Calculate gram matrix
class_docstr_tok: ["Calculate","gram","matrix"]
code: def forward(self, y):
      (b, ch, h, w) = y.shape
      features = y.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
  import argparse
  import paddle
  import paddle.nn
  import numpy
  import paddle.nn.functional
  from paddlehub.env import MODULE_HOME
  from paddlehub.module.module import moduleinfo
  from paddlehub.vision.transforms import Compose, Resize, CenterCrop
  from paddlehub.module.cv_module import StyleTransferModule
label_desc: Use image node_id 1 for calling the GramMatrix obj's underlying member method code with example usage: obj.forward(y) and returns: gram