当前位置:网站首页>What is the tensor in tensorflow?
What is the tensor in tensorflow?
2020-11-06 20:53:00 【Python advanced】
Tensor( tensor )
“ tensor ” The word was originally used by William · Ron · Hamilton is in 1846 In introducing . Yes , It's the Hamilton who invented quaternion :
-
Tensor It's actually a multidimensional array (multidimensional array)
-
Tensor The goal is to be able to create a higher dimensional matrix 、 vector .
An example of color
Color image file (RGB) It's usually handled as 3-d tensor, Every 2d array Medium element Represents a pixel ,R representative Red,G representative Green,B representative Blue
Multidimensional arrays
Draw a cube in three dimensions :
Higher dimensional tensors :
Initialize a vector
0 dimension
tf.tensor(1).print();
1 dimension
tf.tensor([1, 2, 3, 4]).print();
// or
tf.tensor1d([1, 2, 3]).print();
2 dimension
tf.tensor([[1, 2], [3, 4]]).print();
// or
tf.tensor2d([[1, 2], [3, 4]]).print();
3 dimension
tf.tensor([[[1], [2]], [[3], [4]]]).print();
// or
tf.tensor3d([[[1], [2]], [[3], [4]]]).print();
4 dimension
tf.tensor([[[[1], [2]], [[3], [4]]]]).print();
// or
tf.tensor4d([[[[1], [2]], [[3], [4]]]]).print();
5 dimension
tf.tensor([[[[[1], [2]], [[3], [4]]]]]).print();
// or
tf.tensor5d([[[[[1], [2]], [[3], [4]]]]]).print();
6 dimension
tf.tensor([[[[[[1],[2]],[[3],[4]]],[[[5],[6]],[[7],[8]]]]]]).print();
// or
tf.tensor6d([[[[[[1],[2]],[[3],[4]]],[[[5],[6]],[[7],[8]]]]]]).print();
For more articles, please follow my blog Alili The big bang at the front end Subscription number :
Alili The big bang at the front end
版权声明
本文为[Alili, front end big bang]所创,转载请带上原文链接,感谢
边栏推荐
- Summary of front-end interview questions (C, s, s) that front-end engineers need to understand (2)
- ado.net和asp.net的关系
- 【:: 是什么语法?】
- C + + and C + + programmers are about to be eliminated from the market
- 開源一套極簡的前後端分離專案腳手架
- ES6 learning notes (2): teach you to play with class inheritance and class objects
- ES6 learning notes (5): easy to understand ES6's built-in extension objects
- 視覺滾動[反差美]
- C語言I部落格作業03
- What are the common problems of DTU connection
猜你喜欢
ES6 learning notes (2): teach you to play with class inheritance and class objects
How to hide part of barcode text in barcode generation software
ORA-02292: 违反完整约束条件 (MIDBJDEV2.SYS_C0020757) - 已找到子记录
Bitcoin once exceeded 14000 US dollars and is about to face the test of the US election
大数据处理黑科技:揭秘PB级数仓GaussDB(DWS) 并行计算技术
一路踩坑,被迫聊聊 C# 代码调试技巧和远程调试
Basic usage of Vue codemirror: search function, code folding function, get editor value and verify in time
Filecoin has completed a major upgrade and achieved four major project progress!
An article will take you to understand SVG gradient knowledge
CCR coin frying robot: the boss of bitcoin digital currency, what you have to know
随机推荐
[efficiency optimization] Nani? Memory overflow again?! It's time to sum up the wave!!
Network security engineer Demo: the original * * is to get your computer administrator rights! [maintain]
From overseas to China, rancher wants to do research on container cloud market
一部完整的游戏,需要制作哪些音乐?
Git rebase is in trouble. What to do? Waiting line
游戏主题音乐对游戏的作用
Chainlink brings us election results into blockchain everipedia
What is the meaning of sector sealing of filecoin mining machine since the main network of filecoin was put online
C# 调用SendMessage刷新任务栏图标(强制结束时图标未消失)
Tron smart wallet PHP development kit [zero TRX collection]
C + + and C + + programmers are about to be eliminated from the market
An article will take you to understand CSS alignment
Network programming NiO: Bio and NiO
Diamond standard
The method of realizing high SLO on large scale kubernetes cluster
An article taught you to use HTML5 SVG tags
StickEngine-架构12-通信协议
It's time for your financial report to change to a more advanced style -- financial analysis cockpit
Python basic data type -- tuple analysis
How about small and medium-sized enterprises choose shared office?