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

Function _get_step_context

caffe2/python/net_printer.py:321–337  ·  view source on GitHub ↗
(step)

Source from the content-addressed store, hash-verified

319
320
321def _get_step_context(step):
322 proto = step.Proto()
323 if proto.should_stop_blob:
324 return call('loop'), False
325 if proto.num_iter and proto.num_iter != 1:
326 return call('loop', [proto.num_iter]), False
327 if proto.num_concurrent_instances > 1:
328 return (
329 call('parallel',
330 [('num_instances', proto.num_concurrent_instances)]),
331 len(step.Substeps()) > 1)
332 concurrent = proto.concurrent_substeps and len(step.Substeps()) > 1
333 if concurrent:
334 return call('parallel'), True
335 if proto.report_net:
336 return call('run_once'), False
337 return None, False
338
339
340@Printer.register(ExecutionStep)

Callers 1

print_stepFunction · 0.85

Calls 3

callFunction · 0.85
SubstepsMethod · 0.80
ProtoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…