In the context of deep learning frameworks, what is a tensor?
Select an answer to reveal the explanation.
Short Explanation and Infographic
A tensor is really just the data container everything in deep learning gets stored in — a multidimensional array. A single number is technically a tensor with zero dimensions, a list of numbers is a 1D tensor (a vector), a table is a 2D tensor (a matrix), and stacking those tables together, like the RGB channels of a color image, gives you a 3D tensor, and so on upward. That's answer C, and frameworks like TensorFlow literally get their name from this concept. A tensor is not an activation function, that's things like ReLU or sigmoid. It's not a hyperparameter controlling epochs, that's just a training loop setting. And it's not a loss function either, regression tasks use losses like mean squared error, a completely different concept. Tensor is purely about the shape of data, not how the model computes or learns.
Full explanation below image
Full Explanation
A tensor is a generalized, multidimensional array used to store and manipulate data throughout a deep learning model's computations. It generalizes familiar mathematical objects: a scalar is a rank-0 tensor (zero dimensions), a vector is a rank-1 tensor (one dimension), a matrix is a rank-2 tensor (two dimensions), and higher-rank tensors extend this to three or more dimensions, such as a rank-3 tensor representing a color image (height, width, and color channels) or a rank-4 tensor representing a batch of such images. Deep learning frameworks such as TensorFlow and PyTorch represent virtually all data — inputs, weights, activations, gradients, and outputs — as tensors, and they provide highly optimized operations for manipulating them efficiently, often leveraging GPU acceleration for the large-scale numerical computations involved in training and inference.
The first distractor describes an activation function, such as ReLU, sigmoid, or softmax, which is a nonlinear transformation applied to a neuron's or layer's output to introduce nonlinearity into the network; this is a computational operation applied to data, not the data structure itself. The second distractor describes an epoch-related hyperparameter, which governs how many complete passes over the training dataset are performed; this is a training-loop control setting entirely unrelated to how data is structured or stored. The third distractor describes a loss function used for regression, such as mean squared error, which quantifies the difference between predicted and true continuous values; this is a scalar-valued function used to guide optimization, not a data structure for representing model inputs, weights, or activations.
A helpful memory aid: think of tensors as the universal 'container' that holds every piece of numeric data flowing through a deep learning model, regardless of whether that data is a single number, a list, a table, or a stack of tables — the framework's name 'TensorFlow' literally refers to tensors flowing through the computation graph.