Skip to content

Test fixes on add-fire #4317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ml-agents/mlagents/trainers/tests/torch/test_decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_valueheads():
# Test default 1 value per head
value_heads = ValueHeads(stream_names, input_size)
input_data = torch.ones((batch_size, input_size))
value_out, _ = value_heads(input_data) # Note: mean value will be removed shortly
value_out = value_heads(input_data) # Note: mean value will be removed shortly

for stream_name in stream_names:
assert value_out[stream_name].shape == (batch_size,)
Expand All @@ -25,7 +25,7 @@ def test_valueheads():
output_size = 4
value_heads = ValueHeads(stream_names, input_size, output_size)
input_data = torch.ones((batch_size, input_size))
value_out, _ = value_heads(input_data)
value_out = value_heads(input_data)

for stream_name in stream_names:
assert value_out[stream_name].shape == (batch_size, output_size)
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_gaussian_dist_instance():
def test_tanh_gaussian_dist_instance():
torch.manual_seed(0)
act_size = 4
dist_instance = GaussianDistInstance(
dist_instance = TanhGaussianDistInstance(
torch.zeros(1, act_size), torch.ones(1, act_size)
)
for _ in range(10):
Expand Down
6 changes: 4 additions & 2 deletions ml-agents/mlagents/trainers/tests/torch/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_min_visual_size():
for encoder_type in EncoderType:
good_size = ModelUtils.MIN_RESOLUTION_FOR_ENCODER[encoder_type]
vis_input = torch.ones((1, 3, good_size, good_size))
ModelUtils._check_resolution_for_encoder(vis_input, encoder_type)
ModelUtils._check_resolution_for_encoder(good_size, good_size, encoder_type)
enc_func = ModelUtils.get_encoder_for_type(encoder_type)
enc = enc_func(good_size, good_size, 3, 1)
enc.forward(vis_input)
Expand All @@ -34,7 +34,9 @@ def test_min_visual_size():

with pytest.raises(UnityTrainerException):
# Make sure we'd hit a friendly error during model setup time.
ModelUtils._check_resolution_for_encoder(vis_input, encoder_type)
ModelUtils._check_resolution_for_encoder(
bad_size, bad_size, encoder_type
)

enc = enc_func(bad_size, bad_size, 3, 1)
enc.forward(vis_input)
Expand Down