Skip to content
Merged
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
6 changes: 5 additions & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,9 @@ def test_model_forward_intermediates(model_name, batch_size):
spatial_axis = get_spatial_dim(output_fmt)
import math

inpt = torch.randn((batch_size, *input_size))
output, intermediates = model.forward_intermediates(
torch.randn((batch_size, *input_size)),
inpt,
output_fmt=output_fmt,
)
assert len(expected_channels) == len(intermediates)
Expand All @@ -521,6 +522,9 @@ def test_model_forward_intermediates(model_name, batch_size):
assert o.shape[0] == batch_size
assert not torch.isnan(o).any()

output2 = model.forward_features(inpt)
assert torch.allclose(output, output2)


def _create_fx_model(model, train=False):
# This block of code does a bit of juggling to handle any case where there are multiple outputs in train mode
Expand Down