def test_persistent_buffer_list(module: BufferListModule) -> None:
        """Test if the buffer_list is persistent when re-loading the state dict."""
        # create a module, assign the buffer list and get the state dict
        module = BufferListModule()
        tensor_list = [torch.rand(3) for _ in range(3)]
        module.tensor_list = tensor_list
        state_dict = module.state_dict()
        # create a new module and load the state dict
        module = BufferListModule()
        module.load_state_dict(state_dict)
        # assert that the previously set buffer list has been restored
        assert tensor_lists_are_equal(module.tensor_list, tensor_list)
Test if the buffer_list is persistent when re-loading the state dict.
tests/unit/models/components/base/test_buffer_list_mixin.py