Install TensorFlow with CUDA 8.0 + cuDNN 5.1 support on macOS. All instructions are based on TensorFlow Get Started.

Install CUDA and cuDNN

You also need to add this line to your shell config.

export CUDA_HOME=/usr/local/cuda
export PATH="$CUDA_HOME/bin:$PATH"

and build deviceQuery as test your environment.

cd /usr/local/cuda/samples/
make -C 1_Utilities/deviceQuery

Install TensorFlow

Install from pip

Build from source