PyTorch 2 · Tensors

Check shape, type and device

Inspect a tensor's properties.

x.shape, x.dtype, x.device

Official PyTorch 2 documentation

More tensors commands

All tensors commands · PyTorch 2 cheatsheet

Was this page helpful?