This commit is contained in:
Arec
2021-07-27 14:32:52 -07:00

View File

@@ -9,14 +9,23 @@ with open(config_path, 'r') as cfg:
def test_deepsets_policy(): def test_deepsets_policy():
module = DeepSetsPolicy(config) module = DeepSetsPolicy(config)
B = 25
ns = 5 ns = 5
nv = 7 nv = 7
npath = 20 npath = 20
ego_state = torch.rand(ns) ego_state = torch.rand(B, ns)
relative_state = torch.rand(nv, ns) relative_state = torch.rand(B, nv, ns)
path_x = torch.rand(npath) path_x = torch.rand(B, npath)
path_y = torch.rand(npath) path_y = torch.rand(B, npath)
sample = {
"state": ego_state[0],
"relative_state": relative_state[0],
"path_x": path_x[0],
"path_y": path_y[0],
}
module(sample)
sample = { sample = {
"state": ego_state, "state": ego_state,
@@ -24,7 +33,4 @@ def test_deepsets_policy():
"path_x": path_x, "path_x": path_x,
"path_y": path_y, "path_y": path_y,
} }
module(sample) module(sample)
# TODO: Refine test to also test for batch data