def test_swap(self):
        """Test that data attributes are
        always returned in the same order"""
        # Fake x, y
        t1 = list(zip(np.arange(10), np.arange(10)))
        t2 = torch.ones(10).tolist()
        t3 = (torch.ones(10) * 2).tolist()
        t4 = (torch.ones(10) * 3).tolist()

        dataset = make_avalanche_dataset(
            t1,
            data_attributes=[
                TensorDataAttribute(t2, name="logits", use_in_getitem=True),
                TensorDataAttribute(t3, name="logits2", use_in_getitem=True),
            ],
        )

        # Now add another attribute
        dataset = make_avalanche_dataset(
            dataset,
            data_attributes=[
                TensorDataAttribute(t4, name="logits0", use_in_getitem=True),
            ],
        )

        self.assertSequenceEqual([0.0, 0.0, 1.0, 2.0, 3.0], dataset[0])
Test that data attributes are
        always returned in the same order
tests/benchmarks/utils/test_data_attribute.py