From ba93ba5438d61661537a61b8179d7e137d729d75 Mon Sep 17 00:00:00 2001 From: Oren Date: Fri, 10 Mar 2023 16:09:44 +0100 Subject: [PATCH] believe fixed a bug --- tianshou/data/batch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tianshou/data/batch.py b/tianshou/data/batch.py index 7fddda2f4..e20415101 100644 --- a/tianshou/data/batch.py +++ b/tianshou/data/batch.py @@ -19,6 +19,8 @@ def _is_batch_set(obj: Any) -> bool: # "for element in obj" will just unpack the first dimension, # but obj.tolist() will flatten ndarray of objects # so do not use obj.tolist() + if obj.shape == (): + return False return obj.dtype == object and \ all(isinstance(element, (dict, Batch)) for element in obj) elif isinstance(obj, (list, tuple)):