MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _attach_metadata

Function _attach_metadata

tensorflow/python/autograph/impl/api.py:301–317  ·  view source on GitHub ↗

Augments an error with the metadata necessary for rewrite.

(e, f, converted)

Source from the content-addressed store, hash-verified

299
300
301def _attach_metadata(e, f, converted):
302 """Augments an error with the metadata necessary for rewrite."""
303 if hasattr(e, 'ag_pass_through'):
304 return
305
306 metadata = getattr(e, 'ag_error_metadata', None)
307 source_map = f.ag_source_map if converted else {}
308
309 if metadata is None:
310 logging.log(
311 1, 'Caught error in %s (converted=%s)', f, converted, exc_info=True)
312 message = '{}: {}'.format(e.__class__.__name__, e)
313 else:
314 message = None
315
316 cause_tb = traceback.extract_tb(sys.exc_info()[2])[1:]
317 e.ag_error_metadata = _ErrorMetadata(cause_tb, metadata, message, source_map)
318
319
320def _call_unconverted(f, args, kwargs, options, update_cache=True):

Callers 2

_call_unconvertedFunction · 0.85
converted_callFunction · 0.85

Calls 3

_ErrorMetadataClass · 0.85
logMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected