torch.CPUTensorData
export interface CPUTensorData {
storage: TypedStorage;
shape: readonly number[];
dtype: DType;
device: 'cpu';
requires_grad: boolean;
grad_fn?: GradFn;
}storage(TypedStorage)shape(readonly number[])dtype(DType)device('cpu')requires_grad(boolean)grad_fn(GradFn)optional
Internal tensor data structure for CPU tensors.
Contains the metadata and CPU memory reference for tensors allocated on the CPU device. This is the low-level representation that backs the public Tensor class.
Fields:
- storage: TypedArray containing the tensor data
- shape: Dimensions of the tensor
- dtype: Element data type
- device: Always 'cpu' for this variant
- requires_grad: Whether gradients are tracked for this tensor
- grad_fn: Function that computes gradients during backward pass