TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: GoTorch – A Go Implementation of PyTorch

9 点作者 edrenova超过 1 年前
I&#x27;m starting to implement a barebones version of pytorch in Go. The primary motivation is:<p>1. I want to better learn Pytorch and how it works so what better way than to just re-implement some of its core features.<p>2. I write mainly in Go and haven&#x27;t come across a lot of ML support in Go<p>3. I&#x27;d rather have a Go ML service instead of spinning up additional infrastructure to just support a python ML service in my Go projects<p>4. Go&#x27;s static typing, native concurrency (avoid GIL problem in python), efficient memory management, single binary deployment and more make it a better interface compared to python IMO<p>Knowing the Pytorch is mainly implemented in c++ and c under the covers, I&#x27;m not expecting any performance gains by porting it to Go. But still, will be interesting to see how it compares.<p>Check it out below and let me know your thoughts!<p>https:&#x2F;&#x2F;github.com&#x2F;evisdrenova&#x2F;gotorch

2 条评论

waynerad超过 1 年前
Wow, this is an amazing idea! I wish I had time to contribute but I&#x27;m maxed out. I love Go and I always tell people (everybody who will listen) that one should always use a statically typed, strongly typed language for production code.
thrwwycbr超过 1 年前
Have you seen the gorgonia repos?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;gorgonia&#x2F;agogo">https:&#x2F;&#x2F;github.com&#x2F;gorgonia&#x2F;agogo</a><p>They basically went a similar route and had to implement all kinds of data types and GPU code to be able to train their alphago model.<p>In go, the biggest pitfall I&#x27;d imagine is memory management because you cannot influence the GC. So I&#x27;d build up everything with as many references from the start, and integrate it with the pperf tools to be able to benchmark it
评论 #39019031 未加载