MCPcopy Index your code
hub / github.com/pytorch/pytorch / CallWithExceptionIntercept

Function CallWithExceptionIntercept

caffe2/python/workspace.py:225–240  ·  view source on GitHub ↗
(func, op_id_fetcher, net_name, *args, **kwargs)

Source from the content-addressed store, hash-verified

223
224
225def CallWithExceptionIntercept(func, op_id_fetcher, net_name, *args, **kwargs):
226 try:
227 return func(*args, **kwargs)
228 except Exception:
229 op_id = op_id_fetcher()
230 net_tracebacks = operator_tracebacks.get(net_name, None)
231 logger.warning(
232 'Original python traceback for operator `{}` in network '
233 '`{}` in exception above (most recent call last):'.format(
234 op_id, net_name))
235 if net_tracebacks and op_id in net_tracebacks:
236 tb = net_tracebacks[op_id]
237 for line in reversed(tb):
238 logger.warning(' File "{}", line {}, in {}'.format(
239 line[0], line[1], line[2]))
240 raise
241
242
243def RunNetOnce(net):

Callers 5

CreateNetFunction · 0.85
RunNetOnceFunction · 0.85
RunNetFunction · 0.85
_Workspace_runFunction · 0.85

Calls 5

reversedFunction · 0.85
warningMethod · 0.80
funcFunction · 0.70
getMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…