张量
机器学习框架中最基础的数据结构,是标量、向量、矩阵向更高维度的推广。在图像处理中,彩色图片表示为四维张量 [batch, height, width, channels],视频则增加时间维度变为五维。
Timeline (last 90 days)
In Lean, tensors can be represented as indexed finite-dimensional array types, with shape constraints statically checked at compile time via dependent types.
A tensor is the core data structure in machine learning, and can be understood as a general term for multi-dimensional arrays: a scalar is a 0-dimensional tensor, a vector is 1-dimensional, a matrix is 2-dimensional, and higher dimensions are N-dimensional tensors.
A forward pass is the process of a neural network computing once completely from the input layer to the output layer; an autoregressive language model needs N forward passes to generate N tokens, with latency growing linearly with output length; a classifier-style model needs only one forward pass.
张量是机器学习框架中最基础的数据结构,彩色图像通常表示为形状为[batch, height, width, channels]的四维张量,视频则再加一维时间轴。
Neural network weights are essentially multi-dimensional arrays (tensors) stored in file formats such as .safetensors, .gguf, or .bin, and the numbers themselves are static and cannot execute on their own.
Stride records the number of memory units that must be skipped to move one step in each dimension, enabling operations such as transposition and slicing to be completed by modifying strides without copying data
At the implementation level, a tensor is a contiguous block of one-dimensional memory, with two pieces of metadata—shape and stride—describing the multi-dimensional logical view
PyTorch tensors are essentially multi-dimensional arrays, highly similar to NumPy's ndarray, but tensors can run on GPUs and have built-in automatic differentiation support.
All Facts (8)
PyTorch tensors are essentially multi-dimensional arrays, highly similar to NumPy's ndarray, but tensors can run on GPUs and have built-in automatic differentiation support.
60%UnverifiedIn Lean, tensors can be represented as indexed finite-dimensional array types, with shape constraints statically checked at compile time via dependent types.
50%UnverifiedA tensor is the core data structure in machine learning, and can be understood as a general term for multi-dimensional arrays: a scalar is a 0-dimensional tensor, a vector is 1-dimensional, a matrix is 2-dimensional, and higher dimensions are N-dimensional tensors.
50%UnverifiedA forward pass is the process of a neural network computing once completely from the input layer to the output layer; an autoregressive language model needs N forward passes to generate N tokens, with latency growing linearly with output length; a classifier-style model needs only one forward pass.
50%Unverified张量是机器学习框架中最基础的数据结构,彩色图像通常表示为形状为[batch, height, width, channels]的四维张量,视频则再加一维时间轴。
50%UnverifiedNeural network weights are essentially multi-dimensional arrays (tensors) stored in file formats such as .safetensors, .gguf, or .bin, and the numbers themselves are static and cannot execute on their own.
50%UnverifiedStride records the number of memory units that must be skipped to move one step in each dimension, enabling operations such as transposition and slicing to be completed by modifying strides without copying data
50%UnverifiedAt the implementation level, a tensor is a contiguous block of one-dimensional memory, with two pieces of metadata—shape and stride—describing the multi-dimensional logical view
50%