Implemented tensor::flatten() to convert tensors into vectors.