1414"""
1515
1616from __future__ import annotations
17- from typing import TYPE_CHECKING , Any , Dict
17+ from typing import TYPE_CHECKING
1818import time
1919
2020from .aed import from_scratch_model_def , Model , from_scratch_training
@@ -29,21 +29,17 @@ def test():
2929 import returnn .__main__
3030 from returnn .util import better_exchook
3131 from returnn .util import basic as util
32- from returnn .config import get_global_config
3332 from returnn .datasets .util .vocabulary import Vocabulary
3433 import returnn .frontend as rf
3534 from returnn .tensor import Dim
3635 from returnn .torch .frontend .bridge import rf_module_to_pt_module
3736 from i6_experiments .users .zeyer .audio .torch .random_speech_like import generate_dummy_train_input_kwargs
3837
3938 better_exchook .install ()
40- config = get_global_config (auto_create = True )
41- config .update ({"behavior_version" : 20 , "backend" : "torch" , "use_lovely_tensors" : True })
42- util .BehaviorVersion .set (config .int ("behavior_version" , 0 ))
43- returnn .__main__ .config = config
44- returnn .__main__ .init_backend_engine ()
39+ returnn .__main__ .init_backend_engine (
40+ config_opts = {"behavior_version" : 20 , "backend" : "torch" , "use_lovely_tensors" : True }
41+ )
4542
46- rf .select_backend_torch ()
4743 target_dim = Dim (1000 , name = "targets" )
4844 target_dim .vocab = Vocabulary .create_vocab_from_labels ([str (i ) for i in range (target_dim .dimension )], eos_label = 0 )
4945 model : Model = from_scratch_model_def (epoch = 1 , in_dim = Dim (1 , name = "in" ), target_dim = target_dim )
0 commit comments