def METHOD_NAME(self, inputs, partials):
    p = self.prob
    p['comp.x'] = inputs['x']
    p['comp.inp'] = inputs['inp']
    seed = {'comp.out': np.ones(1)}
    stack = []
    comp = p.model.comp
    comp._inputs['inp'] = inputs['inp']
    # store the inputs to each comp (the comp at each node point) by doing nonlinear solves
    # and storing what the inputs are for each node point.  We'll set these inputs back
    # later when we linearize about each node point.
    for i in range(self.num_nodes):
        stack.append(comp._inputs['inp'][0])
        comp._inputs['x'] = inputs['x']
        comp._solve_nonlinear()
        comp._inputs['inp'] = comp._outputs['out']
    for i in range(self.num_nodes):
        p.model._vectors['output']['linear'].set_val(0.0)
        p.model._vectors['residual']['linear'].set_val(0.0)
        comp._inputs['inp'] = stack.pop()
        comp._inputs['x'] = inputs['x']
        p.model._linearize(None)
        jvp = p.compute_jacvec_product(of=['comp.out'], wrt=['comp.x','comp.inp'], mode='rev', seed=seed)
        seed['comp.out'][:] = jvp['comp.inp']
        # all of the comp.x's are connected to the same indepvarcomp, so we have
        # to accumulate their contributions together
        partials[self.pathname + '.out', self.pathname + '.x'] += jvp['comp.x']
        # this one doesn't get accumulated because each comp.inp contributes to the
        # previous comp's .out (or to comp.inp in the case of the first comp) only.
        # Note that we have to handle this explicitly here because normally in OpenMDAO
        # we accumulate derivatives when we do reverse transfers.  We can't do that
        # here because we only have one instance of our component, so instead of
        # accumulating into separate 'comp.out' variables for each comp instance,
        # we would be accumulating into a single comp.out variable, which would make
        # our derivative too big.
        partials[self.pathname + '.out', self.pathname + '.inp'] = jvp['comp.inp']