Both .flatten() and .view(-1) flatten a tensor in PyTorch. What’s the difference?
- Does .flatten()copy the data of the tensor?
- Is .view(-1)faster?
- Is there any situation that .flatten()doesn’t work?
Both .flatten() and .view(-1) flatten a tensor in PyTorch. What’s the difference?
.flatten() copy the data of the tensor?.view(-1) faster?.flatten() doesn’t work?