code: def local_reshape_dimshuffle(fgraph, node):
      """
      If a dimshuffle is inside a reshape and does not change the order
      of dimensions, remove it.
  
      Reshape(Dimshuffle(x), shp) -> Reshape(x, shp)
      """
      if isinstance(node.op, Reshape):
          input_ = node.inputs[0]
          if input_.owner and isinstance(input_.owner.op, DimShuffle):
              new_order = input_.owner.op.new_order
              offset = 0
              for dim in new_order:
                  if dim == "x":
                      continue
                  elif dim != offset:
                      return False
                  else:
                      offset += 1
              return [
                  reshape(
                      input_.owner.inputs[0],
                      node.inputs[1],
                      ndim=node.outputs[0].ndim,
                  )
              ]
      return False
  
file_path: pytensor/pytensor/tensor/rewriting/uncanonicalize.py
imports: from pytensor import scalar
  from pytensor.graph.rewriting.basic import copy_stack_trace, node_rewriter
  from pytensor.tensor.basic import Alloc, alloc, constant
  from pytensor.tensor.elemwise import CAReduce, DimShuffle
  from pytensor.tensor.math import Argmax, Max, MaxAndArgmax, Min, neg
  from pytensor.tensor.rewriting.basic import register_uncanonicalize
  from pytensor.tensor.shape import Reshape, reshape
  from pytensor.tensor.subtensor import Subtensor
label_desc: Use image node_id 4 for calling a global function with example usage: local_reshape_dimshuffle(fgraph, node) and returns: False, list, False