follow layoutlmv3 to avoid device error
# What does this PR do?

Slightly modify the way that we calculate the height and width embeddings for LayoutLMv2. The calculation is simply same as LayoutLMv3 to avoid the device-assert error when we run experiments on GPU. 

https://github.com/huggingface/transformers/blob/main/src/transformers/models/layoutlmv3/modeling_layoutlmv3.py#L270-L271

Fixes # (issue)




## Who can review?



Models:
 - LayoutLMv2: @patrickvonplaten @NielsRogge 



The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_18829). All of your documentation changes will be reflected on that endpoint.<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.