浏览代码

add check that layers still have different dimensions

/fix-resume-imi
Andrew Cohen 4 年前
当前提交
2e5b1352
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
      ml-agents/mlagents/trainers/tests/torch/saver/test_saver.py

8
ml-agents/mlagents/trainers/tests/torch/saver/test_saver.py


# asserts convolutions have different parameters before load
for conv1, conv2 in zip(conv_params, conv_params2):
assert not torch.equal(conv1, conv2)
# asserts layers still have different dimensions
for mod1, mod2 in zip(policy.actor.parameters(), policy2.actor.parameters()):
if mod1.shape[0] == 12:
assert mod2.shape[0] == 10
# asserts layers still have different dimensions
for mod1, mod2 in zip(policy.actor.parameters(), policy2.actor.parameters()):
if mod1.shape[0] == 12:
assert mod2.shape[0] == 10
@pytest.mark.parametrize(

正在加载...
取消
保存