Incubator-mxnet: How to get the data in symbol锛燂紵

Created on 14 Jul 2017  路  1Comment  路  Source: apache/incubator-mxnet

I think锛宼he definition of symbol in mxnet is just like the Variable in pytorrch.
In pytorch, i can use Variable.data to visit the original tensor values, now i want to do same thint in mxnet. Buuut i can't find API which can deal this task.
So anyone knows it?

Most helpful comment

Symbol does not have data inside, but module's get_params() does have information you want.
as http://mxnet.io/api/python/module.html#mxnet.module.BaseModule.get_params
have tensor values you want.

print mod.get_params()
args_params, aux_params = mod.get_params()
args_params['key_you_want_to_see'].asnumpy()

>All comments

Symbol does not have data inside, but module's get_params() does have information you want.
as http://mxnet.io/api/python/module.html#mxnet.module.BaseModule.get_params
have tensor values you want.

print mod.get_params()
args_params, aux_params = mod.get_params()
args_params['key_you_want_to_see'].asnumpy()
Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuconglin picture yuconglin  路  3Comments

dmadeka picture dmadeka  路  3Comments

GuilongZh picture GuilongZh  路  3Comments

dushoufu picture dushoufu  路  3Comments

ranti-iitg picture ranti-iitg  路  3Comments