code: def test_map():
      v = vector("v")
      abs_expr, abs_updates = pt_map(
          lambda x: abs(x),
          v,
          [],
          truncate_gradient=-1,
          go_backwards=False,
      )
  
      f = function(
          [v], abs_expr, updates=abs_updates, allow_input_downcast=True
      )
  
      rng = np.random.default_rng(utt.fetch_seed())
      vals = rng.uniform(-5.0, 5.0, size=(10,))
      abs_vals = abs(vals)
      pytensor_vals = f(vals)
      utt.assert_allclose(abs_vals, pytensor_vals)
  
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 2 for calling a global function with example usage: test_map() without return types