- 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:

推薦閱讀
- Learning SQL Server Reporting Services 2012
- Cortex-M3 + μC/OS-II嵌入式系統開發入門與應用
- 深入淺出SSD:固態存儲核心技術、原理與實戰
- The Applied AI and Natural Language Processing Workshop
- Learning Game Physics with Bullet Physics and OpenGL
- 計算機組裝維修與外設配置(高等職業院校教改示范教材·計算機系列)
- Neural Network Programming with Java(Second Edition)
- 數字媒體專業英語(第2版)
- 電腦組裝與維護即時通
- Spring Cloud實戰
- The Artificial Intelligence Infrastructure Workshop
- 基于網絡化教學的項目化單片機應用技術
- 詳解FPGA:人工智能時代的驅動引擎
- 嵌入式系統原理:基于Arm Cortex-M微控制器體系
- Hands-On Game Development with WebAssembly