Implementing Pytorch-like arbitrary dimensional Tensor in Go

In one of the Karpathy’s videos, he recommends the blogpost by Edward Z. Yang called PyTorch internals to learn about the implementation of Tensor class in Pytorch. The blogpost is fantastic and goes into detailed representation of some of the basic functionality of Tensors. After reading the post, I tried to implement similar functionality in Go using slices. In this post, I will walk through following methods of basic Tensor stuct:...

February 28, 2024 · 5 min · 970 words · Me