Post

My observation of ML frameworks from the POV of a functional programmer: PyTorch tensors are actually some kind of monad, with the dimensions being the "type" of the contained values.

If you treat the tensor monad as fully abstract, you then pretty much get free monad and algebraic effects. You can then do different kinds of abstract interpretation on the free monad, and do things other than the actual computation, such as compiling it to various optimized compute kernels.

0 reposts0 likes