When using mxnet, after building and training a module mod
, I called the method mod.get_params()
to inspect the weights and bias of the model.
However, I found that even if I set the context to mx.gpu(0)
when creating the module, the outputs of the get_params
method always show that the parameters (weights and bias) are on cpu(0)
. See below:
I wonder whether the weights were really on cpu, so I timed the program and found that, it was in fact much faster if I set the context to gpu(0)
than to cpu(0)
. Therefore, I think the weights were in fact on gpu, otherwise the training wouldn't be so fast. But, why did the get_params
method show that my weights were on cpu?