code: def test_reduce():
      v = vector("v")
      s = scalar("s")
      result, updates = pt_reduce(lambda x, y: x + y, v, s)
  
      f = function(
          [v, s], result, updates=updates, allow_input_downcast=True
      )
      rng = np.random.default_rng(utt.fetch_seed())
      v_v = rng.uniform(-5.0, 5.0, size=(5,))
      assert abs(np.sum(v_v) - f(v_v, 0.0)) < 1e-3
  
file_path: pytensor/tests/scan/test_views.py
imports: import numpy
  import pytensor.tensor
  from pytensor import config, function, grad, shared
  from pytensor.compile.mode import FAST_RUN
  from pytensor.scan.views import foldl, foldr
  from pytensor.scan.views import map
  from pytensor.scan.views import reduce
  from pytensor.tensor.type import scalar, vector
  from tests import unittest_tools
  from tests.scan.test_basic import clone_optimized_graph, grab_scan_node
label_desc: Use image node_id 1 for calling a global function with example usage: test_reduce() without return types