code: def check_if_need_transpose(self, IR_node):
      parent = self.IR_graph.get_parent(IR_node.name, [0])
      while parent.type == "Flatten" or parent.type == "Dropout":
          parent = self.IR_graph.get_parent(parent.name, [0])
      dim = len(parent.layer.attr["_output_shapes"].list.shape[0].dim)
      if dim > 2:
          original_dims = self.weights_dict[IR_node.name][
              "weights"
          ].shape
          dims = [
              i.size
              for i in parent.layer.attr["_output_shapes"]
              .list.shape[0]
              .dim[1:]
          ] + [-1]
          self.weights_dict[IR_node.name][
              "weights"
          ] = self.weights_dict[IR_node.name]["weights"]
          self.weights_dict[IR_node.name]["weights"] = np.reshape(
              self.weights_dict[IR_node.name]["weights"], dims
          )
          self.weights_dict[IR_node.name]["weights"] = np.transpose(
              self.weights_dict[IR_node.name]["weights"],
              [dim - 2] + list(range(0, dim - 2)) + [dim - 1],
          )
          self.weights_dict[IR_node.name]["weights"] = np.reshape(
              self.weights_dict[IR_node.name]["weights"], original_dims
          )
  
imports: from mmdnn.conversion.common.DataStructure.emitter import Emitter
  from mmdnn.conversion.common.IR.IR_graph import IRGraph
  import os.path
  import mmdnn.conversion.common.IR.graph_pb2
  import numpy
  import sys
label_desc: Use image node_id 5 for calling the OnnxEmitter obj's underlying member method code with example usage: obj.check_if_need_transpose(IR_node) without return types