- Mastering TensorFlow 1.x
- Armando Fandango
- 131字
- 2021-06-25 22:50:54
Operations
TensorFlow provides us with many operations that can be applied on Tensors. An operation is defined by passing values and assigning the output to another tensor. For example, in the provided Jupyter Notebook file, we define two operations, op1 and op2:
op1 = tf.add(c2,c3)
op2 = tf.multiply(c2,c3)
When we print op1 and op2, we find that they are defined as Tensors:
print('op1 : ', op1)
print('op2 : ', op2)
The output is as follows:
op1 : Tensor("Add:0", shape=(), dtype=float32)
op2 : Tensor("Mul:0", shape=(), dtype=float32)
To print the value of these operations, we have to run them in our TensorFlow session:
print('run(op1) : ', tfs.run(op1))
print('run(op2) : ', tfs.run(op2))
The output is as follows:
run(op1) : 13.0
run(op2) : 42.0
The following table lists some of the built-in operations:

推薦閱讀
- 筆記本電腦使用、維護與故障排除實戰
- Intel FPGA/CPLD設計(基礎篇)
- 基于Proteus和Keil的C51程序設計項目教程(第2版):理論、仿真、實踐相融合
- Creating Dynamic UI with Android Fragments
- Linux運維之道(第2版)
- 電腦常見故障現場處理
- 分布式微服務架構:原理與實戰
- Spring Cloud微服務架構實戰
- Machine Learning Solutions
- 基于Proteus仿真的51單片機應用
- 無蘋果不生活:OS X Mountain Lion 隨身寶典
- Wireframing Essentials
- Hands-On Motion Graphics with Adobe After Effects CC
- 觸摸屏應用技術從入門到精通
- 微服務實戰