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

推薦閱讀
- 圖解西門子S7-200系列PLC入門
- 計(jì)算機(jī)應(yīng)用與維護(hù)基礎(chǔ)教程
- 分布式系統(tǒng)與一致性
- 基于Apache Kylin構(gòu)建大數(shù)據(jù)分析平臺(tái)
- Practical Machine Learning with R
- Machine Learning Solutions
- 單片微機(jī)原理及應(yīng)用
- Arduino項(xiàng)目開(kāi)發(fā):智能生活
- 微服務(wù)實(shí)戰(zhàn)(Dubbox +Spring Boot+Docker)
- Blender 3D By Example
- Raspberry Pi Home Automation with Arduino
- 筆記本電腦現(xiàn)場(chǎng)維修實(shí)錄
- Service Mesh微服務(wù)架構(gòu)設(shè)計(jì)
- DevOps實(shí)戰(zhàn):VMware管理員運(yùn)維方法、工具及最佳實(shí)踐
- 電腦軟硬件維修寶典