Numpy-2-Tensor

Sat 17 May 2025

title: "Numpy 2 Tensor" author: "Raja CSP Raman" date: 2019-05-07 description: "-" type: technical_note draft: false


import tensorflow as tf
import numpy as np
import os

# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
a = np.zeros((3, 3))
ta = tf.convert_to_tensor(a)

with tf.Session() as sess:
    print(sess.run(ta))
[[0. 0. 0.]
 [0. 0. 0.]
 [0. 0. 0.]]

Score: 0

Category: tensorflow-work