3 from __future__
import absolute_import
4 from __future__
import division
5 from __future__
import print_function
6 from __future__
import unicode_literals
8 from multiprocessing
import Process, Queue
17 def _test_set_get(cls, queue, create_store_handler_fn, index, num_procs):
18 store_handler = create_store_handler_fn()
20 value = np.full(1, 1, np.float32)
24 if index == (num_procs - 1):
25 workspace.FeedBlob(blob, value)
26 workspace.RunOperatorOnce(
29 [store_handler, blob],
33 output_blob =
"output_blob" 34 workspace.RunOperatorOnce(
42 np.testing.assert_array_equal(workspace.FetchBlob(output_blob), 1)
43 except AssertionError
as err:
46 workspace.ResetWorkspace()
49 def test_set_get(cls, create_store_handler_fn):
56 for index
in range(num_procs):
59 args=(queue, create_store_handler_fn, index, num_procs, ))
72 def test_get_timeout(cls, create_store_handler_fn):
73 store_handler = create_store_handler_fn()
74 net = core.Net(
'get_missing_blob')
75 net.StoreGet([store_handler], 1, blob_name=
'blob')
76 workspace.RunNetOnce(net)
def _test_set_get(cls, queue, create_store_handler_fn, index, num_procs)