def test_smoke_transform(self, device): x_data = torch.rand(1, 2, 4, 5).to(device) out = F.random_affine(x_data, 0., return_transform=True) assert isinstance(out, tuple) assert len(out) == 2 assert out[0].shape == x_data.shape assert out[1].shape == (1, 3, 3)
def test_batch_multi_params(self, device): x_data = torch.rand(2, 2, 8, 9).to(device) out = F.random_affine(x_data, 0., (0., 0.)) assert out.shape == x_data.shape
def test_smoke_no_transform_batch(self, device): x_data = torch.rand(2, 2, 8, 9).to(device) out = F.random_affine(x_data, 0.) assert out.shape == x_data.shape