code: def local_sum_make_vector(fgraph, node):
      """A sum of a MakeVector node is just the sum of the elements."""
      (array,) = node.inputs
  
      if array.owner is None:
          return
  
      if not isinstance(array.owner.op, MakeVector):
          return
  
      if node.op.axis == ():
          return [array]
  
      # If this is not the case the sum is invalid
      assert (
          node.op.axis is None
          or node.op.axis == (0,)
          or node.op.axis == (-1,)
      )
  
      elements = array.owner.inputs
      acc_dtype = node.op.acc_dtype
      out_dtype = node.op.dtype
      if len(elements) == 0:
          element_sum = zeros(dtype=out_dtype, shape=())
      elif len(elements) == 1:
          element_sum = cast(elements[0], out_dtype)
      else:
          element_sum = cast(
              add(*[cast(value, acc_dtype) for value in elements]),
              out_dtype,
          )
  
      return [element_sum]
  
imports: import logging
  from typing import Union
  import numpy
  import pytensor.scalar.basic
  from pytensor import compile
  from pytensor.compile.ops import ViewOp
  from pytensor.graph import FunctionGraph
  from pytensor.graph.basic import Constant, Variable
  from pytensor.graph.rewriting.basic import NodeRewriter, RemovalNodeRewriter, Rewriter, copy_stack_trace, in2out, node_rewriter
  from pytensor.graph.rewriting.db import RewriteDatabase
  from pytensor.raise_op import Assert, CheckAndRaise, assert_op
  from pytensor.tensor.basic import Alloc, AllocEmpty, Join, MakeVector, ScalarFromTensor, Split, TensorFromScalar, alloc, as_tensor_variable, cast, extract_constant, fill, get_underlying_scalar_constant_value, join, ones_like, register_infer_shape, switch, tensor_copy, zeros, zeros_like
  from pytensor.tensor.elemwise import DimShuffle, Elemwise
  from pytensor.tensor.exceptions import NotScalarConstantError
  from pytensor.tensor.extra_ops import broadcast_arrays
  from pytensor.tensor.math import Sum, add, eq
  from pytensor.tensor.shape import Shape_i, shape_padleft
  from pytensor.tensor.sort import TopKOp
  from pytensor.tensor.type import DenseTensorType, TensorType
  from pytensor.tensor.variable import TensorConstant, TensorVariable
  from pytensor.utils import NoDuplicateOptWarningFilter
label_desc: Use image node_id 27 for calling a global function with example usage: local_sum_make_vector(fgraph, node) and returns: list, list