requires_grad
)backward()
).grad
)torch.nn
torch.nn.Module
Base Classtorch.nn
losses)torch.optim
)torch.utils.data.Dataset
torchvision.transforms
)torch.utils.data.DataLoader
Was this section helpful?
view()
method, detailing its use for reshaping tensors, its requirement for tensor contiguity, and memory sharing.reshape()
method, explaining its flexibility in reshaping both contiguous and non-contiguous tensors, and its behavior regarding data copying.permute()
method, which swaps tensor dimensions, clarifying its effect on tensor shape and contiguity.