Added singledispatch utility to vector.utils & changed order of space argument. (#2536)

* Fixed ordering of space. Added singledispatch utility.

* Added singledispatch utility to vector.utils & changed order of space argument

* Fixed Error from _BaseGymSpaces

* Minor adjustment for Discrete Spaces

* Fixed Tests/ to reflect changes

* Fixed precommit error - custom namespaces

* Concrete Implementations start with _
This commit is contained in:
Rushiv Arora
2022-01-21 11:28:34 -05:00
committed by GitHub
parent 925823661d
commit fcbff7de12
8 changed files with 139 additions and 136 deletions

View File

@@ -108,7 +108,7 @@ def test_write_to_shared_memory(space):
raise TypeError(f"Got unknown type `{type(lhs)}`.")
def write(i, shared_memory, sample):
write_to_shared_memory(i, sample, shared_memory, space)
write_to_shared_memory(space, i, sample, shared_memory)
shared_memory_n8 = create_shared_memory(space, n=8)
samples = [space.sample() for _ in range(8)]
@@ -155,10 +155,10 @@ def test_read_from_shared_memory(space):
raise TypeError(f"Got unknown type `{type(space)}`")
def write(i, shared_memory, sample):
write_to_shared_memory(i, sample, shared_memory, space)
write_to_shared_memory(space, i, sample, shared_memory)
shared_memory_n8 = create_shared_memory(space, n=8)
memory_view_n8 = read_from_shared_memory(shared_memory_n8, space, n=8)
memory_view_n8 = read_from_shared_memory(space, shared_memory_n8, n=8)
samples = [space.sample() for _ in range(8)]
processes = [