From 8a4094037a268fa6d4664e7300b9056e0cf5cb2b Mon Sep 17 00:00:00 2001 From: Johannes Fischer Date: Fri, 23 Jul 2021 11:16:08 +0200 Subject: [PATCH] update forward pass test --- tests/policies/test_forward_pass.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/policies/test_forward_pass.py b/tests/policies/test_forward_pass.py index e9be09a..2bd314f 100644 --- a/tests/policies/test_forward_pass.py +++ b/tests/policies/test_forward_pass.py @@ -10,8 +10,12 @@ with open(config_path, 'r') as cfg: filestr = 'tests/policies/base_' -batch = pickle.load(open(filestr+'_test_batch.pkl', 'rb')) +def test_forward_pass(): +batch = pickle.load(open(filestr + '_test_batch.pkl', 'rb')) batch['relative_state'] = batch['relative_state'].float() policy = BehaviorCloningPolicy.load_model(config, filestr) policy.policy = policy.policy.type(batch['state'].dtype) -action = policy(batch) \ No newline at end of file +action = policy(batch) +i = torch.where(action.isnan())[0] +for key in batch.keys(): + print(batch[key][i])