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 had a question about the equal method. Why does equal method add an extra dimension to the variable calling it? I provided a simple piece of code that demonstrates this. If I choose to set the value with the equal method, scalars become 1D arrays, 1D arrays become 2D arrays ([ ] -> [ [] ]). But when I use the set_val() method this doesn't happen. I am somehow not using these methods correctly but I don't know how. Any help would be greatly appreciated.
I am working in Windows 10 and fxpmath version is 0.4.9.
importnumpyasnpfromfxpmathimportFxp# Create a variable a.a=Fxp(-0.635*np.ones(3), dtype='fxp-s16/14')
print('a = ')
a.info()
# Create a variable b.b=Fxp(0, like=a)
print('Original b = ')
b.info()
# Change the value of b to be equal to a in two different ways.b.set_val(a)
# b.equal(a)print('After changing value of b = ')
b.info()
print(b.shape)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I had a question about the equal method. Why does equal method add an extra dimension to the variable calling it? I provided a simple piece of code that demonstrates this. If I choose to set the value with the equal method, scalars become 1D arrays, 1D arrays become 2D arrays ([ ] -> [ [] ]). But when I use the set_val() method this doesn't happen. I am somehow not using these methods correctly but I don't know how. Any help would be greatly appreciated.
I am working in Windows 10 and fxpmath version is 0.4.9.
Beta Was this translation helpful? Give feedback.
All reactions