code stringlengths 3 6.57k |
|---|
expected.keys() |
assert_allclose(res['size'], expected['size']) |
torch.tensor([0.999, 1.], device=device, dtype=dtype) |
torch.tensor([1., 1.], device=device, dtype=dtype) |
dict(size=torch.tensor([[100, 100]], device=device, dtype=dtype) |
repeat(100, 1) |
res.keys() |
expected.keys() |
assert_allclose(res['size'], expected['size']) |
test_same_on_batch(self, device, dtype) |
torch.manual_seed(42) |
torch.tensor([10, 20]) |
torch.tensor([0.7, 1.3], device=device, dtype=dtype) |
torch.tensor([0.9, 1.1], device=device, dtype=dtype) |
res.keys() |
expected.keys() |
assert_allclose(res['size'], expected['size']) |
TestRandomRectangleGen(RandomGeneratorBaseTests) |
pytest.mark.parametrize('batch_size', [0, 1, 8]) |
pytest.mark.parametrize('height', [200]) |
pytest.mark.parametrize('width', [300]) |
pytest.mark.parametrize('scale', [torch.tensor([.7, 1.1]) |
pytest.mark.parametrize('ratio', [torch.tensor([.7, 1.1]) |
pytest.mark.parametrize('value', [0]) |
pytest.mark.parametrize('same_on_batch', [True, False]) |
scale.to(device=device, dtype=dtype) |
ratio.to(device=device, dtype=dtype) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7, 1.3, 1.5]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7, 1.3, 1.5]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([0.7, 1.3]) |
torch.tensor([.5, .7]) |
torch.tensor([.7, .9]) |
torch.tensor(0.5) |
test_invalid_param_combinations(self, height, width, scale, ratio, value, device, dtype) |
pytest.raises(Exception) |
scale.to(device=device, dtype=dtype) |
ratio.to(device=device, dtype=dtype) |
test_random_gen(self, device, dtype) |
torch.manual_seed(42) |
torch.tensor([0.7, 1.3], device=device, dtype=dtype) |
torch.tensor([0.7, 1.3], device=device, dtype=dtype) |
torch.tensor([100, 100], device=device, dtype=dtype) |
torch.tensor([0, 0], device=device, dtype=dtype) |
torch.tensor([0, 0], device=device, dtype=dtype) |
torch.tensor([6, 8], device=device, dtype=dtype) |
torch.tensor([0.5000, 0.5000], device=device, dtype=dtype) |
res.keys() |
expected.keys() |
assert_allclose(res['widths'], expected['widths']) |
assert_allclose(res['widths'], expected['widths']) |
assert_allclose(res['xs'], expected['xs']) |
assert_allclose(res['ys'], expected['ys']) |
assert_allclose(res['values'], expected['values']) |
test_same_on_batch(self, device, dtype) |
torch.manual_seed(42) |
torch.tensor([0.7, 1.3], device=device, dtype=dtype) |
torch.tensor([0.7, 1.3], device=device, dtype=dtype) |
torch.tensor([100, 100], device=device, dtype=dtype) |
torch.tensor([0, 0], device=device, dtype=dtype) |
torch.tensor([0, 0], device=device, dtype=dtype) |
torch.tensor([10, 10], device=device, dtype=dtype) |
torch.tensor([0.5000, 0.5000], device=device, dtype=dtype) |
res.keys() |
expected.keys() |
assert_allclose(res['widths'], expected['widths']) |
assert_allclose(res['widths'], expected['widths']) |
assert_allclose(res['xs'], expected['xs']) |
assert_allclose(res['ys'], expected['ys']) |
assert_allclose(res['values'], expected['values']) |
TestCenterCropGen(RandomGeneratorBaseTests) |
pytest.mark.parametrize('batch_size', [0, 2]) |
pytest.mark.parametrize('height', [200]) |
pytest.mark.parametrize('width', [200]) |
pytest.mark.parametrize('size', [(100, 100) |
test_valid_param_combinations(self, batch_size, height, width, size, device, dtype) |
center_crop_generator(batch_size=batch_size, height=height, width=width, size=size) |
test_invalid_param_combinations(self, height, width, size, device, dtype) |
pytest.raises(Exception) |
center_crop_generator(batch_size=batch_size, height=height, width=width, size=size) |
test_random_gen(self, device, dtype) |
torch.manual_seed(42) |
center_crop_generator(batch_size=2, height=200, width=200, size=(120, 150) |
torch.tensor([[200, 200], [200, 200]], device=device, dtype=torch.long) |
res.keys() |
expected.keys() |
assert_allclose(res['src'].to(device=device) |
assert_allclose(res['dst'].to(device=device) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.