You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to implement the LookupTable. However the output does not match that from the original torch model. I used the nn.Embedding module and copied the weight tensor from the torch LookupTable. What could be wrong here?
Additional condition in lua_recursive_model
elif name == 'LookupTable':
n1 = Lambda(lambda x: x.view(1,-1) if 1==len(x.size()) else x )
n2 = nn.Embedding(m.weight.size(0),m.weight.size(1))
n2.weight.data.copy_(m.weight)
n = nn.Sequential(n1,n2)
add_submodule(seq,n)
Additional condition in lua_recursive_source
elif name == 'LookupTable':
s1 = 'Lambda(lambda x: x.view(1,-1) if 1==len(x.size()) else x )'
s2 = 'nn.Embedding({},{})'.format(m.weight.size(0),m.weight.size(1))
s += ['nn.Sequential({},{}),#LookupTable'.format(s1,s2)]
The text was updated successfully, but these errors were encountered:
I was trying to implement the LookupTable. However the output does not match that from the original torch model. I used the nn.Embedding module and copied the weight tensor from the torch LookupTable. What could be wrong here?
Additional condition in lua_recursive_model
Additional condition in lua_recursive_source
The text was updated successfully, but these errors were encountered: