def validate_(self, fgraph):
        t0 = time.time()
        try:
            ret = fgraph.execute_callbacks('validate')
        except Exception as e:
            cf = inspect.currentframe()
            uf = cf.f_back
            uf_info = inspect.getframeinfo(uf)

            # If the caller is replace_all_validate, just raise the
            # exception. replace_all_validate will print out the
            # verbose output.
            # Or it has to be done here before raise.
            if uf_info.function == 'replace_all_validate':
                raise
            else:
                verbose = uf.f_locals.get('verbose', False)
                if verbose:
                    r = uf.f_locals.get('r', "")
                    reason = uf_info.function
                    print("validate failed on node %s.\n Reason: %s, %s" %
                          (r, reason, e))
                raise
        t1 = time.time()
        if fgraph.profile:
            fgraph.profile.validate_time += t1 - t0
        return ret
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/gof/toolbox.py/Validator.validate_/original