Cdjones
MModular
•Created by Cdjones on 9/28/2024 in #questions
LLVM ERROR: out of memory
WSL Ubuntu user with 16GB ram. Getting this error using Tensors:
3 replies
MModular
•Created by Cdjones on 7/10/2024 in #questions
Tensor Transposition
After looking through the mojo documentation for the standard library as well as external code repositories, I was unable to find functionality to transpose 2 specified dimensions of a Tensor struct, similar to what's available in libraries such as Pytorch and Numpy. I implemented my own basic function as a brute force approach that iterates through every index, switches the specified dimensions and stores it in a separate Tensor struct. Is there any better way to go about doing this?
I've been trying to look for a way to vectorize this process using SIMD as well as trying to find a way to directly mutate the tensor but can't think of any better approach. I've also tried searching for the source code that Numpy or Pytorch uses for these functions but couldn't seem to find it.
My Current Approach:
https://github.com/mehta302/Tensor-Transpose/blob/main/transpose.mojo
Benchmark:
(with 100x100x100 float32 randomized tensor switching first 2 dimensions)
1 replies