当前位置:网站首页>Four operations in TF

Four operations in TF

2022-08-11 07:51:00 phac123

Only tensors of the same dimension can perform four arithmetic operations

import tensorflow as tfa = tf.ones([1, 3])b = tf.fill([1, 3], 3.)print("a: ", a)print("b: ", b)print("a + b: ", tf.add(a, b))print("a - b: ", tf.subtract(a, b))print("a * b: ", tf.multiply(a, b))print("b / a: ", tf.divide(b, a))

insert image description here

原网站

版权声明
本文为[phac123]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/223/202208110645027915.html