From d0386326bef0eadb92e2260cdd074f3034760b21 Mon Sep 17 00:00:00 2001 From: Wicknight <61172796+Wicknight@users.noreply.github.com> Date: Sat, 13 May 2023 11:11:00 +0800 Subject: [PATCH] Update configurator.py --- recbole_cdr/config/configurator.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/recbole_cdr/config/configurator.py b/recbole_cdr/config/configurator.py index efe4197..47bd8bf 100644 --- a/recbole_cdr/config/configurator.py +++ b/recbole_cdr/config/configurator.py @@ -56,6 +56,7 @@ def __init__(self, model=None, config_file_list=None, config_dict=None): config_file_list (list of str): the external config file, it allows multiple config files, default is None. config_dict (dict): the external parameter dictionaries, default is None. """ + self.compatibility_settings() self._init_parameters_category() self.parameters['Dataset'] += ['source_domain', 'target_domain'] self.yaml_loader = self._build_yaml_loader() @@ -283,3 +284,14 @@ def update(self, other_config): for key in other_config: new_config_obj.final_config_dict[key] = other_config[key] return new_config_obj + + def compatibility_settings(self): + import numpy as np + np.bool = np.bool_ + np.int = np.int_ + np.float = np.float_ + np.complex = np.complex_ + np.object = np.object_ + np.str = np.str_ + np.long = np.int_ + np.unicode = np.unicode_