Skip to content
New issue

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

Optimization A Bit Too Clever/Document it #87

Open
chewxy opened this issue Feb 20, 2017 · 1 comment
Open

Optimization A Bit Too Clever/Document it #87

chewxy opened this issue Feb 20, 2017 · 1 comment

Comments

@chewxy
Copy link
Member

chewxy commented Feb 20, 2017

This graph:

g := NewGraph()
xV, _ := tensor.New(tensor.WithBacking([]float64{1,2,3,4})
yV, _ := tensor.New(tensor.WithBacking([]float64{1,2,3,4})
x := NodeFromAny(g, xV)
y := NodeFromAny(g, yV)

yields this:

add dot

This can be fixed of course, with this:

g := NewGraph()
xV, _ := tensor.New(tensor.WithBacking([]float64{1,2,3,4})
yV, _ := tensor.New(tensor.WithBacking([]float64{1,2,3,4})
x := NodeFromAny(g, xV, WithName("x")) // note the WithName()
y := NodeFromAny(g, yV, WithName("y")) // note the WithName()

which will yield this:

add dot

While it is in fact the correct thing to do (i.e. optimize away and leave with with only one node), this is not user friendly (this bug was encountered by a new user).

Solutions

Either one of these

  1. Document such behaviours.
  2. Add an exception for NodeFromAny to not use newUniqueNode.

Status

Thinking.

@chewxy
Copy link
Member Author

chewxy commented Feb 24, 2017

TODO: investigate the feasibility of applying #81 to this as well

owulveryck added a commit to owulveryck/gorgonnx that referenced this issue Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant