美文网首页
2) Caffe2 Workspace [WIP]

2) Caffe2 Workspace [WIP]

作者: Hexus | 来源:发表于2018-07-31 06:51 被阅读14次

PyBind State

map<string, unique_ptr<Workspace>> gWorkspaces

Global workspace dict: Workspace name => Workspace unique_ptr.

There is a "default" workspace instance transparently instantiated for you.

Workspace* gWorkspace

Global current workspace pointer.

Could be returned by Workspace* GetCurrentWorkspace().

string gCurrentWorkspaceName

Global current workspace name.

switchWorkspaceInternal(string name, bool create_if_missing)

Query workspace name in gWorkspaces.

If not found, create a new workspace with the given name or throw CAFFE_ENFORCE exception.

If found, update both gWorkspace and gCurrentWorkspaceName.

Current Workspace instance

workspace.FeedBlob(blob_name: str, value: array) -> bool

workspace.FetchBlob(blob_name: str) -> array

Referenced Workspace instance

workspace.C.Workspace(...)

Create a Workspace C++ instance. See example here.

If another Workspace is passed to the constructor, that passed Workspace is the parent of the new Workspace to be initialized. See example here. Implementation details: 1. Binding. 2. C++ Constructor.

ws.run(...)

A Workspace can run Plan, Net, Operator.

相关文章

网友评论

      本文标题:2) Caffe2 Workspace [WIP]

      本文链接:https://www.haomeiwen.com/subject/peqcvftx.html