We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NewVector
Hi. I found something strange when using NewVector. When I create two vectors in a row:
g := gorgonia.NewGraph() a := gorgonia.NewVector(g, gorgonia.Float64, gorgonia.WithShape(2)) b := gorgonia.NewVector(g, gorgonia.Float64, gorgonia.WithShape(2), gorgonia.WithInit(gorgonia.Zeroes())) fmt.Println(a.Value(), b.Value()) gorgonia.Let(a, tensor.New(tensor.WithShape(2), tensor.WithBacking([]float64{1,2}))) fmt.Println(a.Value(), b.Value())
The output indicates that the two vectors share the memory space.
<nil> <nil> [1 2] [1 2]
However, if I give different names to two vectors:
g := gorgonia.NewGraph() a := gorgonia.NewVector(g, gorgonia.Float64, gorgonia.WithName("a"), gorgonia.WithShape(2)) b := gorgonia.NewVector(g, gorgonia.Float64, gorgonia.WithName("b"), gorgonia.WithShape(2), gorgonia.WithInit(gorgonia.Zeroes())) fmt.Println(a.Value(), b.Value()) gorgonia.Let(a, tensor.New(tensor.WithShape(2), tensor.WithBacking([]float64{1,2}))) fmt.Println(a.Value(), b.Value())
They have individual memory spaces.
<nil> [0 0] [1 2] [0 0]
It seems that:
Is it a bug or something wrong by myself? It's really strange.
The version is:
gorgonia.org/gorgonia v0.9.0-beta.0.20181027224840-11edd62a505a
Thanks a lot :D
The text was updated successfully, but these errors were encountered:
I will have a closer look, but it looks like that it is a duplicate of #87
Sorry, something went wrong.
Closing as this issue is definitely related to issue 87.
No branches or pull requests
Hi. I found something strange when using
NewVector
. When I create two vectors in a row:The output indicates that the two vectors share the memory space.
However, if I give different names to two vectors:
They have individual memory spaces.
It seems that:
Is it a bug or something wrong by myself? It's really strange.
The version is:
Thanks a lot :D
The text was updated successfully, but these errors were encountered: