Caffe2 - Python API
A deep learning, cross platform ML framework
Public Member Functions | List of all members
caffe2.python.onnx.workspace.Workspace Class Reference
Inheritance diagram for caffe2.python.onnx.workspace.Workspace:

Public Member Functions

def __init__ (self)
def __getattr__ (self, attr)
def __del__ (self)

Detailed Description

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

The documentation for this class was generated from the following file: