def validate(self, fgraph):
        if not hasattr(fgraph, 'destroyers'):
            return True

        outputs_to_validate = list(fgraph.outputs)[self.first_idx:
                                                   self.last_idx]

        for out in outputs_to_validate:

            if out.owner is None:
                continue

            # Validate that the node that produces the output does not produce
            # it by modifying something else inplace.
            node = out.owner
            op = node.op
            out_idx = node.outputs.index(out)
            if hasattr(op, 'destroy_map') and out_idx in op.destroy_map:
                raise theano.gof.InconsistencyError(
                    "A function graph Feature has requested (probably for ",
                    "efficiency reasons for scan) that outputs of the graph",
                    "be prevented from being the result of inplace ",
                    "operations. This has prevented output ", out, " from ",
                    "being computed by modifying another variable ",
                    "inplace.")
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/gof/toolbox.py/NoOutputFromInplace.validate/original