"src/include/ConstantTensorDescriptor.hpp" did not exist on "50b96745c68d17c3c03b4492d23867eb5e859aa7"
Commit 49be8ea2 authored by lintangsutawika's avatar lintangsutawika
Browse files

moved constructor process to inside load_yaml_config

parent 60a7af8b
...@@ -489,11 +489,20 @@ def import_function(loader, node): ...@@ -489,11 +489,20 @@ def import_function(loader, node):
return function return function
# Add the import_function constructor to the YAML loader def ignore_constructor(loader, node):
yaml.add_constructor("!function", import_function) return node
def simple_load_yaml_config(yaml_path=None, yaml_config=None, yaml_dir=None):
yaml.add_constructor("!function", ignore_constructor)
with open(yaml_path, "rb") as file:
yaml_config = yaml.full_load(file)
return yaml_config
def load_yaml_config(yaml_path=None, yaml_config=None, yaml_dir=None): def load_yaml_config(yaml_path=None, yaml_config=None, yaml_dir=None):
# Add the import_function constructor to the YAML loader
yaml.add_constructor("!function", import_function)
if yaml_config is None: if yaml_config is None:
with open(yaml_path, "rb") as file: with open(yaml_path, "rb") as file:
yaml_config = yaml.full_load(file) yaml_config = yaml.full_load(file)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment