PyTorch for WebGPU
I'm excited about this for probably different reasons than most: I think Typescript could be a more ergonomic way to develop ML models than Python because you can automatically infer and check tensor dimensions <i>while you are writing code!</i> Compare this to the mess of comments you usually see writing pytorch telling you that x is of shape [x, y, z].<p><pre><code>  // An empty 3x4 matrix
  const tensorA = tensor([3, 4])
  
  // An empty 4x5 matrix
  const tensorB = tensor([4, 5])

  const good = multiplyMatrix(tensorA, tensorB);
        ^
        Inferred type is Tensor<readonly [3, 5]>
  
  const bad = multiplyMatrix(tensorB, tensorA);
                             ^^^^^^^
                             Argument of type 'Tensor<readonly [4, 5]>' is not 
                             assignable to parameter of type '[never, "Differing 
                             types", 3 | 5]'.(2345)
</code></pre>
I prototyped this for PotatoGPT [1] and some kind stranger on the internet wrote up a more extensive take [2]. You can play with an early version on the Typescript playground here [3] (uses a twitter shortlink for brevity)<p>[1] <a href="https://github.com/newhouseb/potatogpt">https://github.com/newhouseb/potatogpt</a><p>[2] <a href="https://sebinsua.com/type-safe-tensors" rel="nofollow">https://sebinsua.com/type-safe-tensors</a><p>[3] <a href="https://t.co/gUzzTl4AAN" rel="nofollow">https://t.co/gUzzTl4AAN</a>