3 ms·
The latest versions of PyTorch (compiled from repo) already do this: > x = torch.rand(4, 3) > x.size() torch.Size([4, 3]) > x.shape torch.Si
by cs702 9y ago
The latest versions of PyTorch (compiled from repo) already do this:
> x = torch.rand(4, 3)
> x.size()
torch.Size([4, 3])
> x.shape
torch.Size([4, 3])
Their explicitly stated goal is to match numpy semantics as much as possible :-)