Skip to content(if available)orjump to list(if available)

Show HN: Cant – Library written in Rust that provides PyTorch-like functionality

Show HN: Cant – Library written in Rust that provides PyTorch-like functionality

4 comments

·July 27, 2025

Hey! This is something i have been working on. A tiny neural networking lib to learn how something like pytorch works, and to improve my own coding standards.

RickarySanchez

Any new rust based ML library is great in my book. I've taken a brief look at the candle tensor implementation and just took an even briefer look at the can-t tensor implementation. What was the reasoning behind a global equation to store all tensors grads etc ? My initial assumption would be that it might make more sense to store that data scoped within a `Graph` type or similar.

bwfan123

Kudos, great start. Ambitious effort, for it to be successful you could zero-in on a specific application and make that better than pytorch for training/inference.

Many users of pytorch are scientists and folks only peripherally interested in software. For them, python scripting is great because of its low barrier to entry. The torch ecosystem is large, and consists of folks like that. They are unlikely to learn things like rust. So, instead of wholesale reimplementation of pytorch, a better bet would be to replace parts of pytorch that are slow and bloated. Those parts would be invisible to end-users, and would be a great candidate for a rust refactor.

msgodel

Oh that's pretty elegant. Good job.

dage212

[dead]