torch.Tensor.size — PyTorch 1.10.1 documentation
pytorch.org › generated › torchTensor.size(dim=None) → torch.Size or int Returns the size of the self tensor. If dim is not specified, the returned value is a torch.Size, a subclass of tuple . If dim is specified, returns an int holding the size of that dimension. Parameters dim ( int, optional) – The dimension for which to retrieve the size. Example: