class_docstr: Partial testing.
  
  What could be tested:
  - increment vs set
  - thing incremented: scalar, vector, matrix,
  - increment/set: constant, scalar, vector, matrix
  - indices: scalar vs slice, constant vs variable, out of bound, ...
  - inplace
  
  NOTE: these are the same tests as test_incsubtensor.py, but using
  the new (read: not deprecated) inc_subtensor, set_subtensor
  functions.
class_docstr_tok: ["Partial","testing",".","What","could","be","tested",":","-","increment","vs","set","-","thing","incremented",":","scalar",",","vector",",","matrix",",","-","increment\/set",":","constant",",","scalar",",","vector",",","matrix","-","indices",":","scalar","vs","slice",",","constant","vs","variable",",","out","of","bound",",","...","-","inplace","NOTE",":","these","are","the","same","tests","as","test_incsubtensor.py",",","but","using","the","new","(","read",":","not","deprecated",")","inc_subtensor",",","set_subtensor","functions","."]
code: def test_wrong_broadcast(self):
      a = tt.col()
      increment = tt.vector()
  
      # These symbolic graphs legitimate, as long as increment has exactly
      # one element. So it should fail at runtime, not at compile time.
      rng = np.random.RandomState(utt.fetch_seed())
  
      def rng_randX(*shape):
          return rng.rand(*shape).astype(theano.config.floatX)
  
      for op in (tt.set_subtensor, tt.inc_subtensor):
          for base in (a[:], a[0]):
              out = op(base, increment)
              f = theano.function([a, increment], out)
              # This one should work
              f(rng_randX(3, 1), rng_randX(1))
              # These ones should not
              self.assertRaises(
                  ValueError, f, rng_randX(3, 1), rng_randX(2)
              )
              self.assertRaises(
                  ValueError, f, rng_randX(3, 1), rng_randX(3)
              )
              self.assertRaises(
                  ValueError, f, rng_randX(3, 1), rng_randX(0)
              )
  
file_path: Theano/theano/tensor/tests/test_inc_subtensor.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import unittest
  from theano.tests import unittest_tools
  import theano
  import theano.tensor
label_desc: Use image node_id 4 for calling the Test_inc_subtensor obj's underlying member method code with example usage: obj.test_wrong_broadcast() and returns: rng