Get the parameter size of AnalogContext correctly #547
Replies: 2 comments 1 reply
-
Hi @Zhaoxian-Wu, for name, tile in model.named_analog_tiles():
print(name, tile.get_x_size(), tile.get_d_size()) This will get the individual crossbar sizes (there might be more than one used for a layer). To get the size of the layer you can simply use: Another alternative is to get the full weights of the layer (however, that might involve a copy and should be avoid for performance reasons): |
Beta Was this translation helpful? Give feedback.
-
Note that there is also a summary tool: from aihwkit.utils.analog_info import analog_summary
analog_summary(model) This will print out the later sizes and crossbar configurations etc. |
Beta Was this translation helpful? Give feedback.
-
It seems impossible to access the weight size in the parameters. To be specific, I run the following code:
it outputs that
The param size is incorrect here (
[784, 256]
is wanted but[]
is returned).I understand that to access the correct weight, we should use the following snippet instead
and we get
But do we have a more convenient way to the size of the linear layer through
param
?Beta Was this translation helpful? Give feedback.
All reactions