(ws, obj)
| 685 | |
| 686 | |
| 687 | def _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 | |
| 706 | def _Workspace_feed_blob(ws, name, arr, device_option=None): |
nothing calls this directly
no test coverage detected
searching dependent graphs…