浏览代码

[bug-fix] Fix typo (#5035)

* Fix typo

* Add test
/develop/gail-srl-hack
GitHub 4 年前
当前提交
af36ef3b
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 2
      ml-agents/mlagents/trainers/buffer.py
  2. 4
      ml-agents/mlagents/trainers/tests/test_buffer.py

2
ml-agents/mlagents/trainers/buffer.py


dimension is equal to the length of the AgentBufferField.
"""
if len(self) > 0 and not isinstance(self[0], list):
return np.asanyarray(self, dytpe=dtype)
return np.asanyarray(self, dtype=dtype)
shape = None
for _entry in self:

4
ml-agents/mlagents/trainers/tests/test_buffer.py


assert np.array_equal(padded[0], np.array([1, 1, 1, 1]))
assert np.array_equal(padded[1], np.array([2, 2, 3, 3]))
# Make sure it doesn't fail when the field isn't a list
padded_a = a.padded_to_batch()
assert np.array_equal(padded_a, a)
def fakerandint(values):
return 19

正在加载...
取消
保存