Exemple #1
0
 def test_load_success_with_crc_pass(self):
     """Test load success."""
     summary_dir = tempfile.mkdtemp()
     file1 = os.path.join(summary_dir, 'summary.01')
     write_file(file1, SCALAR_RECORD)
     ms_loader = MSDataLoader(summary_dir)
     ms_loader._latest_summary_filename = 'summary.00'
     ms_loader.load(ComputingResourceManager(1, 1))
     shutil.rmtree(summary_dir)
     tag = ms_loader.get_events_data().list_tags_by_plugin('scalar')
     tensors = ms_loader.get_events_data().tensors(tag[0])
     assert len(tensors) == 3
Exemple #2
0
 def test_load_success_with_crc_pass(self, crc_pass):
     """Test load success."""
     summary_dir = tempfile.mkdtemp()
     file1 = os.path.join(summary_dir, 'summary.01')
     write_file(file1, SCALAR_RECORD)
     ms_loader = MSDataLoader(summary_dir)
     ms_loader._latest_summary_filename = 'summary.00'
     ms_loader.load()
     assert ms_loader._latest_summary_filename == 'summary.01'
     assert ms_loader._latest_summary_file_size == RECORD_LEN
     tag = ms_loader.get_events_data().list_tags_by_plugin('scalar')
     tensors = ms_loader.get_events_data().tensors(tag[0])
     assert len(tensors) == 3
Exemple #3
0
 def test_load_single_pb_file(self):
     """Test load pb file success."""
     filename = 'ms_output.pb'
     summary_dir = tempfile.mkdtemp()
     create_graph_pb_file(output_dir=summary_dir, filename=filename)
     ms_loader = MSDataLoader(summary_dir)
     ms_loader.load(ComputingResourceManager(1, 1))
     events_data = ms_loader.get_events_data()
     plugins = events_data.list_tags_by_plugin(PluginNameEnum.GRAPH.value)
     shutil.rmtree(summary_dir)
     assert len(plugins) == 1
     assert plugins[0] == filename