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_grad_inc_set(self):
      def inc_slice(*s):
          def just_numeric_args(a, b):
              return tt.inc_subtensor(a[s], b)
  
          return just_numeric_args
  
      def set_slice(*s):
          def just_numeric_args(a, b):
              return tt.set_subtensor(a[s], b)
  
          return just_numeric_args
  
      for f_slice in [inc_slice, set_slice]:
          # vector
          utt.verify_grad(
              f_slice(slice(2, 4, None)),
              (
                  np.asarray([0, 1, 2, 3, 4, 5.0]),
                  np.asarray([9, 9.0]),
              ),
          )
  
          # matrix
          utt.verify_grad(
              f_slice(slice(1, 2, None), slice(None, None, None)),
              (
                  np.asarray([[0, 1], [2, 3], [4, 5.0]]),
                  np.asarray([[9, 9.0]]),
              ),
          )
  
          # single element
          utt.verify_grad(
              f_slice(2, 1),
              (
                  np.asarray([[0, 1], [2, 3], [4, 5.0]]),
                  np.asarray(9.0),
              ),
          )
  
          # broadcast
          utt.verify_grad(
              f_slice(2),
              (
                  np.asarray([[0, 1], [2, 3], [4, 5.0]]),
                  np.asarray(9.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 6 for calling the Test_inc_subtensor obj's underlying member method code with example usage: obj.test_grad_inc_set() and returns: just_numeric_args, just_numeric_args, tt, tt