You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/09/03 08:34:39 UTC
[GitHub] x10000year opened a new issue #7714: How symbol composition works?
x10000year opened a new issue #7714: How symbol composition works?
URL: https://github.com/apache/incubator-mxnet/issues/7714
The following code:
x = mx.symbol.Variable('x')
y = mx.symbol.Variable('y')
a = x * 2
b = y + a
c = b(y=a)
If we run print(c.tojson()), we can find that there are two duplicate input variables named "x" in symbol c, and the expression a is computed twice. Is this the expected result?
The output of c.tojson() is:
{
"nodes": [
{
"op": "null",
"name": "x",
"inputs": []
},
{
"op": "_mul_scalar",
"name": "_mulscalar0",
"attr": {"scalar": "2"},
"inputs": [[0, 0, 0]]
},
{
"op": "null",
"name": "x",
"inputs": []
},
{
"op": "_mul_scalar",
"name": "_mulscalar0",
"attr": {"scalar": "2"},
"inputs": [[2, 0, 0]]
},
{
"op": "elemwise_add",
"name": "_plus0",
"inputs": [[1, 0, 0], [3, 0, 0]]
}
],
"arg_nodes": [0, 2],
"node_row_ptr": [0, 1, 2, 3, 4, 5],
"heads": [[4, 0, 0]],
"attrs": {"mxnet_version": ["int", 1101]}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services