Esempio n. 1
0
 def test_device_path(self):
     all_edgetpu_paths = edgetpu_utils.ListEdgeTpuPaths(
         edgetpu_utils.EDGE_TPU_STATE_NONE)
     engine = BasicEngine(
         test_utils.test_data_path('mobilenet_v1_1.0_224_quant.tflite'),
         all_edgetpu_paths[0])
     self.assertEqual(engine.device_path(), all_edgetpu_paths[0])
Esempio n. 2
0
    def test_use_all_edge_tpu(self):
        available_tpus = edgetpu_utils.ListEdgeTpuPaths(
            edgetpu_utils.EDGE_TPU_STATE_UNASSIGNED)
        recorded_tpus = []
        engine_list = []
        for _ in available_tpus:
            engine = BasicEngine(
                test_utils.test_data_path('mobilenet_v1_1.0_224_quant.tflite'))
            recorded_tpus.append(engine.device_path())
            engine_list.append(engine)

        remaining_tpus = edgetpu_utils.ListEdgeTpuPaths(
            edgetpu_utils.EDGE_TPU_STATE_UNASSIGNED)
        self.assertEqual(0, len(remaining_tpus))
        self.assertTupleEqual(tuple(recorded_tpus), available_tpus)