

"torch.empty()"


"torch.rand()"


"torch.randn()"


"torch.ones()"


"torch.tensor()"


"torch.zeros()"


Named dimensions
See "names" for restrictions on tensor names.
Use "names" to access the dimension names of a tensor and "rename()"
to rename named dimensions.



imgs = torch.randn(1, 2, 2, 3 , names=('N', 'C', 'H', 'W'))
imgs.names
   ('N', 'C', 'H', 'W')
renamed_imgs = imgs.rename(H='height', W='width')
renamed_imgs.names
   ('N', 'C', 'height', 'width)



Named tensors can coexist with unnamed tensors; named tensors are
instances of "torch.Tensor". Unnamed tensors have "None"-named
dimensions. Named tensors do not require all dimensions to be named.



imgs = torch.randn(1, 2, 2, 3 , names=(None, 'C', 'H', 'W'))
imgs.names
   (None, 'C', 'H', 'W')



Name propagation semantics
Named tensors use names to automatically check that APIs are being
called correctly at runtime. This occurs in a process called *name