Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Copying data is wasteful, mutating data is dangerous. Parent comment
The solution was to dictate that the API is copying. But also provide ways to allow the user to manage their own memory.
e.g.
a = tensor.New(tensor.WithShape(2,2), tensor.Of(Float64)) b, err := a.Apply(sigmoid) // copies c, err := a.Apply(sigmoid, tensor.WithReuse(a)) // mutates
There are no comments on this comment yet.
The solution was to dictate that the API is copying. But also provide ways to allow the user to manage their own memory.
e.g.
Docs: https://godoc.org/gorgonia.org/tensor#Dense.Apply