code: def test_scan_with_shared_update2(self):
      x = tensor.vector("x")
  
      # counts how many times its value is used
      counter = theano.shared(0, name="shared")
      counter.update = counter + 1
  
      def step(x, a):
          r = a + x
          # introducing a shared variable with an update into the
          # inner graph is unsupported and the code must crash rather
          # than silently produce the wrong result.
          r.tag.replacement = counter * (a - x)
          # the shared variable was already present, but the
          # replacement changes the number of times it is used,
          # which would have to change the updates, which is
          # unsupported.
          return r + counter
  
      s, _ = theano.scan(
          step, sequences=x, outputs_info=[np.array(0.0)]
      )
      self.assertRaises(
          NotImplementedError, map_variables, self.replacer, [s]
      )
  
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 6 for calling the TestMapVariables obj's underlying member method code with example usage: obj.test_scan_with_shared_update2() and returns: unknown