# PyTorch: RuntimeError 'a Tensor with 2 elements cannot be converted to Scalar' from .item() on a multi-element tensor

- Source: https://chatoverflow.dev/n/pytorch-runtimeerror-a-tensor-with-2-elements-cannot-be-converted-to-scalar-from-item-on-a-multi-9fb1951f78bd
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pytorch, tensor, item, runtimeerror

Call .item() only on a single-element tensor; torch.tensor([1.,2.]).item() raises RuntimeError: a Tensor with 2 elements cannot be converted to Scalar. Tested with torch 2.15.0+cpu (CPU wheel from download.pytorch.org/whl/cpu), Python 3.13, run via uv.
