shlogg · Early preview
Super Kai (Kazuya Ito) @superkai_kazuya

Flatten() Vs Ravel(): Understanding Dimensionality In PyTorch

Flatten() and ravel() explained: removing dimensions from tensors with optional start_dim and end_dim arguments. Examples in PyTorch.

Buy Me a Coffee☕
*Memos:

My post explains flatten() and ravel().
My post explains Unflatten().
My post explains unflatten().

Flatten() can remove zero or more dimensions by selecting dimensions from the 0D or more D tensor of zero or more elements, getting the 1D or more D tensor of zero or more elements as shown below:
*Memos:

The 1st argument for initialization is start_dim(Optional-Default:1-Type:int).
The 2nd argument for initialization is end_dim(Optional-Default:-1-Type:int).
The 1st argument is input(Required-Type:tensor of int, float, complex or bool).
Flatten() can change a 0D ten...