code: def __call__(self, graph):
      for node in graph.nodes:
          if node.data is None:
              continue
          if node.kind not in self.reshaped_node_types:
              # Check for 2+ dimensional data
              if any(len(tensor.shape) > 1 for tensor in node.data):
                  print_stderr(
                      "Warning: parameters not reshaped for node: {}".format(
                          node
                      )
                  )
              continue
          transpose_order = self.map(node.kind)
          weights = node.data[0]
          if (
              node.kind == NodeKind.InnerProduct
          ) and self.has_spatial_parent(node):
              # The FC layer connected to the spatial layer needs to be
              # re-wired to match the new spatial ordering.
              in_shape = node.get_only_parent()[0].output_shape
              fc_shape = weights.shape
              output_channels = fc_shape[0]
              weights = weights.reshape(
                  (
                      output_channels,
                      in_shape.channels,
                      in_shape.height,
                      in_shape.width,
                  )
              )
              weights = weights.transpose(
                  self.map(NodeKind.Convolution)
              )
              node.reshaped_data = weights.reshape(
                  fc_shape[transpose_order[0]],
                  fc_shape[transpose_order[1]],
              )
          else:
              node.reshaped_data = weights.transpose(transpose_order)
          # node.reshaped_data = weights.transpose(transpose_order)
      if self.replace:
          for node in graph.nodes:
              if hasattr(node, "reshaped_data"):
                  # Set the weights
                  node.data[0] = node.reshaped_data
                  del node.reshaped_data
      return graph
  
imports: from __future__ import unicode_literals
  from google.protobuf import text_format
  import numpy
  from mmdnn.conversion.caffe.graph import GraphBuilder, NodeKind, LAYER_IN_TRAIN_PROTO
  from mmdnn.conversion.caffe.mapper import NodeMapper, get_handler_name
  from mmdnn.conversion.caffe.resolver import get_caffe_resolver, has_pycaffe
  from mmdnn.conversion.caffe.errors import print_stderr, ConversionError
  from mmdnn.conversion.caffe.common_graph import Graph
  from mmdnn.conversion.caffe.utils import get_lower_case, get_upper_case
label_desc: Use image node_id 5 for calling the DataReshaper obj's underlying member method code with example usage: obj.__call__(graph) and returns: graph