The Eager Execution of the TensorFlow library can be used to convert a tensor to a NumPy array in Python. With Eager Execution, the behavior of the operations of TensorFlow library changes, and the operations execute immediately. We can also perform NumPy operations on Tensor objects with Eager Execution. The Tensor.numpy() function converts the Tensor to a NumPy array in Python. In TensorFlow 2.0, the Eager Execution is enabled by default. So, this approach works best for the TensorFlow version 2.0. See the following code example.
import tensorflow as tf
tensor = tf.constant([[1,2,3],[4,5,6],[7,8,9]])
print("Tensor = ",tensor)
array = tensor.numpy()
print("Array = ",array)