当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Will blockchain be the antidote to the global epidemic accelerating the transformation of Internet enterprises?
- Bitcoin once exceeded 14000 US dollars and is about to face the test of the US election
- Xmppmini project details: step by step from the principle of practical XMPP technology development 4. String decoding secrets and message package
- 嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王涛
- An article takes you to understand CSS gradient knowledge
- image operating system windows cannot be used on this platform
- Analysis of serilog source code -- how to use it
- C#和C/C++混合编程系列5-内存管理之GC协同
- html+vue.js 實現分頁可相容IE
- 一部完整的游戏,需要制作哪些音乐?
猜你喜欢

理解格式化原理

What is alicloud's experience of sweeping goods for 100 yuan?

Python basic data type -- tuple analysis

It's time for your financial report to change to a more advanced style -- financial analysis cockpit

What course of artificial intelligence? Will it replace human work?

行为型模式之解释器模式

统计项目代码行数

2020年数据库技术大会助力技术提升

To Lianyun analysis: why is IPFs / filecoin mining so difficult?

前端未來趨勢之原生API:Web Components
随机推荐
【應用程式見解 Application Insights】Application Insights 使用 Application Maps 構建請求鏈路檢視
python100例項
C + + and C + + programmers are about to be eliminated from the market
如何对数据库账号权限进行精细化管理?
Staying up late summarizes the key points of report automation, data visualization and mining, which is different from what you think
解决 WPF 绑定集合后数据变动界面却不更新的问题
ORA-02292: 违反完整约束条件 (MIDBJDEV2.SYS_C0020757) - 已找到子记录
html+vue.js 實現分頁可相容IE
Small program introduction to proficient (2): understand the four important files of small program development
From overseas to China, rancher wants to do research on container cloud market
文件过多时ls命令为什么会卡住?
What if the front end doesn't use spa? - Hacker News
EOS founder BM: what's the difference between UE, UBI and URI?
An article will introduce you to CSS3 background knowledge
An article will take you to understand SVG gradient knowledge
Swagger 3.0 brushes the screen every day. Does it really smell good?
游戏开发中的新手引导与事件管理系统
How to understand Python iterators and generators?
Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
Introduction to Google software testing