class_docstr: A callback to reorder reshape operators when the patterns are as below:
  
  Pattern #1:
  1   %62 = nn.dense(%61, meta[relay.Constant][13] /* ty=Tensor[(64, 64), float32] */,
              units=None, out_dtype="float32") /* ty=Tensor[(3136, 64), float32] */;
  2   %63 = reshape(%62, newshape=[1, 3136, 64]) /* ty=Tensor[(1, 3136, 64), float32] */;
  3   %64 = add(meta[relay.Constant][4] /* ty=Tensor[(64), float32] */, %63)
              /* ty=Tensor[(1, 3136, 64), float32] */;
  
  Pattern #2:
  1   %76 = nn.dense(%75, meta[relay.Constant][18] /* ty=Tensor[(512, 64), float32] */,
              units=None, out_dtype="float32") /*  ty=Tensor[(3136, 512), float32] */;
  2   %77 = reshape(%76, newshape=[1, 3136, 512]) /* ty=Tensor[(1, 3136, 512), float32] */;
  3   %78 = add(meta[relay.Constant][15] /* ty=Tensor[(512), float32] */, %77)
              /* ty=Tensor[(1, 3136, 512), float32] */;
  4   %79 = divide(%78, 1.41421f /* ty=float32 */) /* ty=Tensor[(1, 3136, 512), float32] */;
  5   %80 = erf(%79) /* ty=Tensor[(1, 3136, 512), float32] */;
  6   %81 = add(%80, 1f /* ty=float32 */) /* ty=Tensor[(1, 3136, 512), float32] */;
  7   %82 = multiply(%78, %81) /* ty=Tensor[(1, 3136, 512), float32] */;
  8   %83 = multiply(%82, 0.5f /* ty=float32 */) /* ty=Tensor[(1, 3136, 512), float32] */;
class_docstr_tok: ["A","callback","to","reorder","reshape","operators","when","the","patterns","are","as","below",":","Pattern","#","1",":","1","%","62","=","nn.dense","(","%","61",",","meta","[","relay.Constant","]","[","13","]","\/","*","ty=Tensor","[","(","64",",","64",")",",","float32","]","*","\/",",","units=None",",","out_dtype=","''","float32","''",")","\/","*","ty=Tensor","[","(","3136",",","64",")",",","float32","]","*","\/",";","2","%","63","=","reshape","(","%","62",",","newshape=","[","1",",","3136",",","64","]",")","\/","*","ty=Tensor","[","(","1",",","3136",",","64",")",",","float32","]","*","\/",";","3","%","64","=","add","(","meta","[","relay.Constant","]","[","4","]","\/","*","ty=Tensor","[","(","64",")",",","float32","]","*","\/",",","%","63",")","\/","*","ty=Tensor","[","(","1",",","3136",",","64",")",",","float32","]","*","\/",";","Pattern","#","2",":","1","%","76","=","nn.dense","(","%","75",",","meta","[","relay.Constant","]","[","18","]","\/","*","ty=Tensor","[","(","512",",","64",")",",","float32","]","*","\/",",","units=None",",","out_dtype=","''","float32","''",")","\/","*","ty=Tensor","[","(","3136",",","512",")",",","float32","]","*","\/",";","2","%","77","=","reshape","(","%","76",",","newshape=","[","1",",","3136",",","512","]",")","\/","*","ty=Tensor","[","(","1",",","3136",",","512",")",",","float32","]","*","\/",";","3","%","78","=","add","(","meta","[","relay.Constant","]","[","15","]","\/","*","ty=Tensor","[","(","512",")",",","float32","]","*","\/",",","%","77",")","\/","*","ty=Tensor","[","(","1",",","3136",",","512",")",",","float32","]","*","\/",";","4","%","79","=","divide","(","%","78",",","1.41421f","\/","*","ty=float32","*","\/",")","\/","*","ty=Tensor","[","(","1",",","3136",",","512",")",",","float32","]","*","\/",";","5","%","80","=","erf","(","%","79",")","\/","*","ty=Tensor","[","(","1",",","3136",",","512",")",",","float32","]","*","\/",";","6","%","81","=","add","(","%","80",",","1f","\/","*","ty=float32","*","\/",")","\/","*","ty=Tensor","[","(","1",",","3136",",","512",")",",","float32","]","*","\/",";","7","%","82","=","multiply","(","%","78",",","%","81",")","\/","*","ty=Tensor","[","(","1",",","3136",",","512",")",",","float32","]","*","\/",";","8","%","83","=","multiply","(","%","82",",","0.5f","\/","*","ty=float32","*","\/",")","\/","*","ty=Tensor","[","(","1",",","3136",",","512",")",",","float32","]","*","\/",";"]
docstr: Recursively retrieve attributes from reshape operator.
docstr_tok: ["Recursively","retrieve","attributes","from","reshape","operator","."]
code: def get_attr(self, pre):
      """Recursively retrieve attributes from reshape operator."""
  
      def visit_func(expr):
          if isinstance(expr, _expr.Call) and expr.op == relay.op.get(
              "reshape"
          ):
              new_attrs = {}
              for k in expr.attrs.keys():
                  new_attrs[k] = expr.attrs[k]
              self.attr_map["reshape"] = new_attrs
  
      _analysis.post_order_visit(pre, visit_func)
  
imports: import logging
  from functools import reduce
  import tvm.ir
  from tvm import relay
  from tvm.ir import Op
  from tvm.relay import expr
  from tvm.relay import transform
  from tvm.relay.analysis import analysis
  from tvm.relay.expr import Call, GlobalVar, TupleGetItem, const
  from tvm.relay.expr_functor import ExprMutator, ExprVisitor
  from ...None import _ffi_api
  from ...dataflow_pattern import DFPatternCallback, is_constant, is_expr, is_op, rewrite, wildcard
  from .register import register_pattern_table
label_desc: Use image node_id 2 for calling the DenseReshapeBiasGeluRewrite obj's underlying member method code with example usage: obj.get_attr(pre) without return types