From e94f122afc4e997f0b5482c7a4b027aad80a3b0c Mon Sep 17 00:00:00 2001 From: Wei Xu Date: Thu, 21 Sep 2023 18:11:37 -0700 Subject: [PATCH] Fix policy_trainer_test MyEnv needs to have is_tensor_based --- alf/algorithms/rl_algorithm_test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alf/algorithms/rl_algorithm_test.py b/alf/algorithms/rl_algorithm_test.py index b690098c4..96c1088ca 100644 --- a/alf/algorithms/rl_algorithm_test.py +++ b/alf/algorithms/rl_algorithm_test.py @@ -102,6 +102,10 @@ def __init__(self, batch_size, obs_shape=(2, ), reward_dim=1): shape=(), dtype='int64', minimum=0, maximum=2) self.reset() + @property + def is_tensor_based(self): + return True + def observation_spec(self): return self._observation_spec