Skip to content
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

[Enhancement] Reduce the randomness in unit test of stylegan3_utils.py #1306

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ def test_integer_transformation():
print(z.shape)
print(m.shape)

# cover more lines
t = torch.zeros(2)
z, m = apply_integer_translation(x, t[0], t[1])

t = torch.ones(2) * 2
z, m = apply_integer_translation(x, t[0], t[1])


def test_fractional_translation():
x = torch.randn(1, 3, 16, 16)
Expand All @@ -24,6 +31,13 @@ def test_fractional_translation():
print(z.shape)
print(m.shape)

# cover more lines
t = torch.zeros(2)
z, m = apply_fractional_translation(x, t[0], t[1])

t = torch.ones(2) * 2
z, m = apply_fractional_translation(x, t[0], t[1])


@pytest.mark.skipif(
digit_version(TORCH_VERSION) < digit_version('1.8.0'),
Expand Down