- TensorFlow 2.0 Quick Start Guide
- Tony Holdroyd
- 79字
- 2021-06-24 16:02:04
Transposing TensorFlow and matrix multiplication
To transpose a matrix and matrix multiplication eagerly, use the following:
u = tf.constant([[3,4,3]])
v = tf.constant([[1,2,1]])
tf.matmul(u, tf.transpose(a=v))
The output will be as follows:
<tf.Tensor: id=555345, shape=(1, 1), dtype=int32, numpy=array([[14]], dtype=int32)>
Note, again, that the default integer type is tf.int32 and the default float type is tf.float32.
All of the operations that are available for tensors that form part of a computational graph are also available for eager execution variables.
There is a complete list of these operations at https://www.tensorflow.org/api_guides/python/math_ops.
推薦閱讀
- 玩轉(zhuǎn)智能機(jī)器人程小奔
- Design for the Future
- 21小時(shí)學(xué)通AutoCAD
- 微型計(jì)算機(jī)控制技術(shù)
- ServiceNow Cookbook
- Visual Basic從初學(xué)到精通
- 傳感器技術(shù)應(yīng)用
- Windows環(huán)境下32位匯編語言程序設(shè)計(jì)
- Windows游戲程序設(shè)計(jì)基礎(chǔ)
- 貫通Java Web開發(fā)三劍客
- Microsoft System Center Confi guration Manager
- Visual FoxPro程序設(shè)計(jì)
- Ansible 2 Cloud Automation Cookbook
- 大數(shù)據(jù):引爆新的價(jià)值點(diǎn)
- 中國戰(zhàn)略性新興產(chǎn)業(yè)研究與發(fā)展·數(shù)控系統(tǒng)