https://tensorflow.google.cn/guide/tensor
Introduction to Tensors
Tensors
are multi-dimensional arrays with a uniform type (called adtype
).tf.dtypes
included all supported dtypes.
If you're familiar withNumPy
, tensors are (kind of) likenp.arrays
.All tensors are immutable
andonly create a new one
, just like Python numbers and strings: you can never update the contents of a tensor.
About shapes
Tensors have shapes. Some vocabulary:
Shape
: The length (number of elements) of each of the axes of a tensor.Rank
: Number of tensor axes:- A scalar has rank 0,
- a vector has rank 1,
- a matrix is rank 2.
Axis or Dimension
: A particular dimension of a tensor.Size
: The total number of items in the tensor, the product of the shape vector's elements.
Note: Although you may see reference to a "tensor of two dimensions", a rank-2 tensor does not usually describe a 2D space.
Tensors and tf.TensorShape
objects have convenient properties for accessing these:
- SciTech-BigDataAIML-Tensorflow-In BigDataAIML Tensorflow troduction SciTechscitech-bigdataaiml-tensorflow-in bigdataaiml scitech-bigdataaiml-tensorflow-in scitech-bigdataaiml-tensorflow-in differentiation scitech-bigdataaiml-tensorflow-va scitech-bigdataaiml-tensorflow-wr scitech-bigdataaiml-tensorflow-va bigdataaiml scitech-bigdataaiml-tensorflow-wr bigdataaiml scitech-bigdataaiml-jupyter scitech-bigdataaiml-pytorch notebook jupyter scitech-bigdataaiml-jupyter