Public Member Functions | |
def | __init__ (self) |
def | __getattr__ (self, attr) |
def | __del__ (self) |
An object representing a Caffe2 workspace. It is a context manager, so you can say 'with workspace:' to use the represented workspace as your global workspace. It also supports every method supported by caffe2.python.workspace, but instead of running these operations in the global workspace, it runs them in the workspace represented by this object. When this object goes dead, the workspace (and all nets and blobs within it) are freed. Why do we need this class? Caffe2's workspace model is very "global state" oriented, in that there is always some ambient global workspace you are working in which holds on to all of your networks and blobs. This class makes it possible to work with workspaces more locally, and without forgetting to deallocate everything in the end.
Definition at line 37 of file workspace.py.