AI4Finance-Foundation / AI4Finance-Foundation/ElegantRL
list(map()) bug
Ouverte
bug
- Langage dominant
- Python
- Étoiles
- 4.4k
- Forks
- 978
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
注意到在[PR#202](https://github.com/AI4Finance-Foundation/ElegantRL/pull/202)中为了加快速度,将`list()`替换成`[]`,但是将所有的`list(map())`都替换成了`[map()]`,例如[AgentBase.py](https://github.com/AI4Finance-Foundation/ElegantRL/blob/master/elegantrl/agents/AgentBase.py)第282行:
```python
traj_list1 = [map(list, zip(*traj_list))] # state, reward, done, action, noise
```
这不会引起迭代展开,而是生成了单个元素的list对象,如下:
```python
>>> list(map(list, zip(*((1,2,3),(4,5,6)))))
[[1, 4], [2, 5], [3, 6]]
>>> [map(list, zip(*((1,2,3),(4,5,6))))]
[]
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.