def fast_inplace_check(inputs):
    """
    Return the variables in inputs that are posible candidate for as inputs of
    inplace operation.

    Parameters
    ----------
    inputs : list
        Inputs Variable that you want to use as inplace destination.

    """
    fgraph = inputs[0].fgraph
    Supervisor = theano.compile.function_module.Supervisor
    protected_inputs = [f.protected for f in fgraph._features
                        if isinstance(f, Supervisor)]
    protected_inputs = sum(protected_inputs, [])  # flatten the list
    protected_inputs.extend(fgraph.outputs)

    inputs = [i for i in inputs if
              not isinstance(i, graph.Constant) and
              not fgraph.destroyers(i) and
              i not in protected_inputs]
    return inputs
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/gof/destroyhandler.py/fast_inplace_check/original