[tensorflow] Placeholder(多維)-撰寫一個99乘法表

文章目录

問題

撰寫一個99乘法表,利用Placeholder(多維)

程式碼

#載入tensorflow lib
import tensorflow as tf 

# 宣告placeholder    
x = tf.placeholder(tf.float32)
y = tf.placeholder(tf.float32, shape=(9))
z = x*y

arr = [i for i in range(1,10)]

with tf.Session() as sess:
    for i in range(1,10):
        res = sess.run(z, feed_dict={x: i,y: arr})
        print(res)

相关文章

MNIST数据集可以说是深度学习的入门,但是使用模型预测单张M...
1、新建tensorflow环境(1)打开anacondaprompt,输入命令行...
这篇文章主要介绍“张量tensor是什么”,在日常操作中,相信...
tensorflow中model.fit()用法model.fit()方法用于执行训练过...
https://blog.csdn.net/To_be_little/article/details/12443...
根据身高推测体重const$=require('jquery');const...