You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Tensor.md 1.1 kB

6 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # 第一章: Tensor
  2. ### Represents one of the outputs of an Operation
  3. ### 表示一个操作的输出
  4. ##### What is Tensor?
  5. ##### Tensor 是什么?
  6. Tensor holds a multi-dimensional array of elements of a single data type which is very similar with numpy's ndarray.
  7. Tensor是一个具有单一数据类型的多维数组容器,非常类似于numpy里的ndarray。如果你对numpy非常熟悉的话,那么对Tensor的理解会相当容易。
  8. ##### How to create a Tensor?
  9. ##### 如何创建一个Tensor?
  10. TF uses column major order.
  11. TF 采用的是按列存储模式,如果我们用NumSharp产生一个2 X 3的矩阵,如果按顺序从0到5访问数据的话,是不会得到1-6的数字的,而是得到1,4, 2, 5, 3, 6这个顺序的一组数字。
  12. ```cs
  13. // generate a matrix:[[1, 2, 3], [4, 5, 6]]
  14. var nd = np.array(1f, 2f, 3f, 4f, 5f, 6f).reshape(2, 3);
  15. // the index will be 0 2 4 1 3 5, it's column-major order.
  16. ```
  17. ![column-major order](_static/column-major-order.png)
  18. ![row-major order](_static/row-major-order.png)

tensorflow框架的.NET版本,提供了丰富的特性和API,可以借此很方便地在.NET平台下搭建深度学习训练与推理流程。