def testWithGivenSession(session): with option_context({'vineyard.socket': '/tmp/vineyard.sock'}): tensor1 = tensor(np.arange(12).reshape(3, 4), chunk_size=2) object_id = tovineyard(tensor1).execute(session=session) tensor2 = from_vineyard(object_id) tensor1_value = tensor1.execute(session=session) tensor2_value = tensor2.execute(session=session) np.testing.assert_array_equal(tensor1_value, tensor2_value)
def testWithGivenSession(session): ipc_socket = os.environ.get('VINEYARD_IPC_SOCKET', '/tmp/vineyard/vineyard.sock') with option_context({'vineyard.socket': ipc_socket}): tensor1 = tensor(np.arange(12).reshape(3, 4), chunk_size=2) object_id = tovineyard(tensor1).execute( session=session).fetch() tensor2 = from_vineyard(object_id) tensor1_value = tensor1.execute(session=session).fetch() tensor2_value = tensor2.execute(session=session).fetch() np.testing.assert_array_equal(tensor1_value, tensor2_value)