コード例 #1
0
 def test_from_env(self):
     self.assertEqual(Config.from_env({'INPUT_NAMES': 'input1,input2:0',
                                       'OUTPUT_NAMES': 'output',
                                       'INPUT_FORMATS': 'channels_first,channels_first',
                                       'MAX_BATCH_SIZE': '1'}),
                      Config(input_info=[('input1', DataFormat.CHANNELS_FIRST),
                                         ('input2:0', DataFormat.CHANNELS_FIRST)],
                             output_names=['output'],
                             max_batch_size=1))
コード例 #2
0
 def test_from_env_all_names(self):
     self.assertEqual(Config.from_env({'INPUT_NAMES': 'input',
                                       'INPUT_SHAPES': '[1, 2, 3, 4]',
                                       'OUTPUT_NAMES': 'output',
                                       'MAX_BATCH_SIZE': '1',
                                       'ENABLE_NHWC_TO_NCHW': '0'}),
                      Config(input_names=['input'],
                             input_shapes=[[1, 2, 3, 4]],
                             output_names=['output'],
                             max_batch_size=1,
                             enable_nhwc_to_nchw=False))
コード例 #3
0
 def test_from_env_no_names(self):
     self.assertEqual(Config.from_env({'OUTPUT_NAMES': 'output',
                                       'MAX_BATCH_SIZE': '1'}),
                      Config(input_info=None,
                             output_names=['output'],
                             max_batch_size=1))
コード例 #4
0
 def test_from_env_no_names(self):
     self.assertEqual(Config.from_env({}), Config())