code: def test_Nin_1out(self):
      # Test grad is called correctly for a many-to-1 op
      gval0 = theano.tensor.scalar()
      gval1 = theano.tensor.scalar()
  
      class TestOp(gof.op.Op):
          __props__ = ()
  
          def make_node(self):
              inputs = [theano.tensor.scalar(), theano.tensor.scalar()]
              outputs = [theano.tensor.matrix()]
              return gof.Apply(self, inputs, outputs)
  
          def grad(self, inp, grads):
              x0, x1 = inp
              (gz,) = grads
              return (gval0, gval1)
  
      a1 = TestOp().make_node()
      g = grad_sources_inputs([(a1.outputs[0], one)], None)
      self.assertTrue(g[a1.inputs[0]] is gval0)
      self.assertTrue(g[a1.inputs[1]] is gval1)
  
imports: from __future__ import absolute_import, print_function, division
  from collections import OrderedDict
  import unittest
  import numpy
  from six.moves import xrange
  import theano
  from theano import gof, change_flags
  from theano.compat import izip
  from theano.tests import unittest_tools
  from theano import gradient
  from theano import config
  from theano.gof.null_type import NullType
  from theano.sandbox.rng_mrg import MRG_RandomStreams
label_desc: Use image node_id 5 for calling the testgrad_sources_inputs obj's underlying member method code with example usage: obj.test_Nin_1out() and returns: gof, gval0,  gval1