code: def test_leaf_inside_scan(self):
      x = tensor.vector("x")
      y = tensor.scalar("y")
      z = tensor.scalar("z")
  
      y.tag.replacement = z
  
      s, _ = theano.scan(lambda x: x * y, sequences=x)
      (s2,) = map_variables(self.replacer, [s])
  
      f = theano.function([x, y, z], [s, s2])
      rval = f(x=np.array([1, 2, 3], dtype=np.float32), y=1, z=2)
      assert np.array_equal(rval, [[1, 2, 3], [2, 4, 6]])
  
file_path: Theano/theano/scan_module/tests/test_scan_utils.py
imports: from __future__ import absolute_import, print_function, division
  import itertools
  import unittest
  import numpy
  import theano
  from theano import tensor
  from theano.scan_module.scan_utils import equal_computations, map_variables
  from theano.tensor.type_other import NoneConst
label_desc: Use image node_id 3 for calling the TestMapVariables obj's underlying member method code with example usage: obj.test_leaf_inside_scan() without return types