def testClearAllCollection(self): config = de_config_pb2.DynamicEmbeddingConfig(embedding_dimension=5) context.add_to_collection('first', config) context.add_to_collection('second', config) collections = context.get_all_collection() self.assertLen(collections, 2) context.clear_all_collection() collections = context.get_all_collection() self.assertLen(collections, 0)
def setUp(self): super(DynamicMemoryOpsTest, self).setUp() self._config = test_util.default_de_config(2) self._service_server = test_util.start_kbs_server() self._kbs_address = 'localhost:%d' % self._service_server.port() context.clear_all_collection()
def setUp(self): super(DynamicNormalizationTest, self).setUp() self._service_server = test_util.start_kbs_server() self._kbs_address = 'localhost:%d' % self._service_server.port() context.clear_all_collection()
def setUp(self): super(CandidateSamplingOpsTest, self).setUp() self._service_server = test_util.start_kbs_server() self._kbs_address = 'localhost:%d' % self._service_server.port() context.clear_all_collection()