fix(factory): ensure output and input features are set only if not already defined (#1771)

Co-authored-by: Steven Palma <imstevenpmwork@ieee.org>
This commit is contained in:
Maximilian Li
2025-10-18 00:50:34 +02:00
committed by GitHub
parent 92b6254473
commit f7c4f99545

View File

@@ -360,8 +360,10 @@ def make_policy(
raise ValueError("env_cfg cannot be None when ds_meta is not provided")
features = env_to_policy_features(env_cfg)
cfg.output_features = {key: ft for key, ft in features.items() if ft.type is FeatureType.ACTION}
cfg.input_features = {key: ft for key, ft in features.items() if key not in cfg.output_features}
if not cfg.output_features:
cfg.output_features = {key: ft for key, ft in features.items() if ft.type is FeatureType.ACTION}
if not cfg.input_features:
cfg.input_features = {key: ft for key, ft in features.items() if key not in cfg.output_features}
kwargs["config"] = cfg
if cfg.pretrained_path: