← TensorFlow & Keras learning path
TensorFlow & Keras · Module 2 of 10

Tensors and operations

Work with tensors, shapes and maths in TensorFlow.

📖 Key ideas

  1. tf.constant([[1, 2], [3, 4]]) creates a tensor.
  2. Tensors have shape and dtype.
  3. Operations: tf.add, tf.matmul, element-wise maths.
  4. tf.Variable holds trainable values.
  5. Eager execution runs operations immediately.
💡 Real-life example: Tensors are containers of numbers stacked in boxes within boxes.
TensorMulti-dimensional array
ShapeSize of each dimension
tf.VariableMutable tensor for weights
Eager executionImmediate operation execution