def test_multi_collection_match(out_dir):
    pre_test_clean_up()
    hook = SessionHook(
        out_dir=out_dir,
        include_regex=["loss:0"],
        include_collections=["default", "trial"],
        save_config=SaveConfig(save_interval=2),
    )
    hook.get_collection("trial").include("loss:0")
    helper_test_multi_collection_match(out_dir, hook)
def test_save_config_modes(out_dir):
    pre_test_clean_up()
    hook = SessionHook(out_dir=out_dir, include_collections=["weights"])
    hook.get_collection("weights").save_config = {
        modes.TRAIN: SaveConfigMode(save_interval=2),
        modes.EVAL: SaveConfigMode(save_interval=3),
    }
    helper_save_config_modes(out_dir, hook)