(text, op)
| 279 | |
| 280 | @Printer.register(OperatorDef) |
| 281 | def 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) |
no test coverage detected
searching dependent graphs…