smaug icon indicating copy to clipboard operation
smaug copied to clipboard

Workspace is not a singleton

Open xyzsam opened this issue 5 years ago • 1 comments

Workspace is the global container of all operators and tensors in the network, and we generally just assume that there is only one. Should we enforce this property by making Workspace a singleton? I am not sure if it will impact the unit tests (since there may be a good reason to have multiple Workspaces in tests).

xyzsam avatar Aug 09 '20 06:08 xyzsam

One additional benefit of a singleton Workspace is that we can get rid of having every Operator take a Workspace argument. We can just use Workspace::Get() or some other similar API.

xyzsam avatar Aug 09 '20 22:08 xyzsam