

def on_change_input(self, fgraph, app, i, old_r, new_r, reason):
    '\n            app.inputs[i] changed from old_r to new_r.\n\n            '
    if (app == 'output'):
        pass
    else:
        self.clients[old_r][app] -= 1
        if (self.clients[old_r][app] == 0):
            del self.clients[old_r][app]
        self.clients.setdefault(new_r, {
            
        }).setdefault(app, 0)
        self.clients[new_r][app] += 1
        for (o_idx, i_idx_list) in iteritems(getattr(app.op, 'view_map', {
            
        })):
            if (len(i_idx_list) > 1):
                raise NotImplementedError()
            i_idx = i_idx_list[0]
            output = reason.outputs[o_idx]
            if (i_idx == i):
                if (app.inputs[i_idx] is not new_r):
                    raise ProtocolError('wrong new_r on change')
                self.view_i[output] = new_r
                self.view_o[old_r].remove(output)
                if (not self.view_o[old_r]):
                    del self.view_o[old_r]
                self.view_o.setdefault(new_r, OrderedSet()).add(output)
    self.stale_droot = True

dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/gof/destroyhandler.py DestroyHandler.on_change_input/VarMisuse@167/243 `app`->`reason`