In tensorflow 2.0.0, it can be done in the following way:
import tensorflow as tf
my_str = tf.constant('Hello World')
my_str_npy = my_str.numpy()
print(my_str_npy)
type(my_str_npy)
This converts a string tensor into a string of ‘bytes’ class
In tensorflow 2.0.0, it can be done in the following way:
import tensorflow as tf
my_str = tf.constant('Hello World')
my_str_npy = my_str.numpy()
print(my_str_npy)
type(my_str_npy)
This converts a string tensor into a string of ‘bytes’ class