I tried to replicate this code in google colab using tensorFlow 2.16.1 and python 3.10.12 and didn't notice any warning. I am attaching gist file for your reference.
Please let us know if the warning still persists with more details on the issue like the platform, TensorFlow and python version details to better understand the issue.