Stack a list of 1D tensors into a 2D tensor along a new first dimension.
Unlike concatenation, stacking creates a new dimension.
Input:
tensors: A list of 1D tensors, each of shape (n,)
Output: A 2D tensor of shape (len(tensors), n).
API Reference:
torch.stack(tensors, dim=0) jnp.stack(tensors, axis=0)