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

Function print_op

caffe2/python/net_printer.py:281–300  ·  view source on GitHub ↗
(text, op)

Source from the content-addressed store, hash-verified

279
280@Printer.register(OperatorDef)
281def print_op(text, op):
282 args = [(a.name, _arg_val(a)) for a in op.arg]
283 dev_opt_txt = format_device_option(op.device_option)
284 if dev_opt_txt:
285 args.append(('device_option', dev_opt_txt))
286
287 if text.c2_net_name:
288 text.add(call(
289 text.c2_net_name + '.' + op.type,
290 [list(op.input), list(op.output)] + args))
291 else:
292 text.add(call(
293 op.type,
294 list(op.input) + args,
295 op.output,
296 factor_prefixes=text.factor_prefixes))
297 for arg in op.arg:
298 if arg.HasField('n'):
299 with text.context('arg: %s' % arg.name):
300 text(arg.n)
301
302
303@Printer.register(NetDef)

Callers 1

debug_netFunction · 0.85

Calls 8

_arg_valFunction · 0.85
format_device_optionFunction · 0.85
callFunction · 0.85
listFunction · 0.85
textFunction · 0.85
appendMethod · 0.45
addMethod · 0.45
contextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…