I was not able to get tf to work with the latest versions. Using anaconda (via brew) I was finally able to get this to work by using slightly older versions:
conda install python=3.11
pip install tensorflow==2.15.1
pip install tensorflow-metal
then:
import tensorflow as tf
print(tf.__version__)
print(tf.config.list_physical_devices('GPU'))
gave me:
2.15.1
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]