MCPcopy Create free account
hub / github.com/pytorch/pytorch / _Workspace_run

Function _Workspace_run

caffe2/python/workspace.py:687–703  ·  view source on GitHub ↗
(ws, obj)

Source from the content-addressed store, hash-verified

685
686
687def _Workspace_run(ws, obj):
688 if hasattr(obj, 'Proto'):
689 obj = obj.Proto()
690 if isinstance(obj, caffe2_pb2.PlanDef):
691 return ws._run_plan(obj.SerializeToString())
692 if isinstance(obj, caffe2_pb2.NetDef):
693 return CallWithExceptionIntercept(
694 ws._run_net,
695 ws._last_failed_op_net_position,
696 GetNetName(obj),
697 obj.SerializeToString(),
698 )
699 # return ws._run_net(obj.SerializeToString())
700 if isinstance(obj, caffe2_pb2.OperatorDef):
701 return ws._run_operator(obj.SerializeToString())
702 raise ValueError(
703 "Don't know how to do Workspace.run() on {}".format(type(obj)))
704
705
706def _Workspace_feed_blob(ws, name, arr, device_option=None):

Callers

nothing calls this directly

Calls 5

isinstanceFunction · 0.85
GetNetNameFunction · 0.85
ProtoMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…