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

Function analyze_task

caffe2/python/net_printer.py:122–134  ·  view source on GitHub ↗
(analyzer, task)

Source from the content-addressed store, hash-verified

120
121@Analyzer.register(Task)
122def analyze_task(analyzer, task):
123 # check that our plan protobuf is not too large (limit of 64Mb)
124 step = task.get_step()
125 plan = Plan(task.node)
126 plan.AddStep(step)
127 proto_len = len(plan.Proto().SerializeToString())
128 assert proto_len < 2 ** 26, (
129 'Due to a protobuf limitation, serialized tasks must be smaller '
130 'than 64Mb, but this task has {} bytes.' % proto_len)
131
132 is_private = task.workspace_type() != WorkspaceType.GLOBAL
133 with analyzer.set_workspace(do_copy=is_private):
134 analyzer(step)
135
136
137@Analyzer.register(TaskGroup)

Callers

nothing calls this directly

Calls 6

AddStepMethod · 0.95
ProtoMethod · 0.95
PlanClass · 0.90
get_stepMethod · 0.80
set_workspaceMethod · 0.80
workspace_typeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…