An error about Bayesian RNN in docunment

#1

Hi, it is the first time I come mxnet forum for help. Here is my question:
when I rerun the code in bayes-by-backprop-rnn.ipynb, there reports an error,
TypeError: list indices must be integers or slices, not Context
how can I fix it, please help me.

#2

I run the notebook and I got the same error. The error is happening in the following function:

    def set_params_to(self, new_values):
        for model_param, new_value in zip(self.collect_params().values(), new_values):
            model_param_ctx = model_param.list_ctx()[0]
            model_param._data[ model_param_ctx ] = new_value
        return

The error is happening when the context of the data is set model_param._data[ model_param_ctx ] = new_value so I replaced the line with the following:

 model_param._data = [new_value.copyto(context)]

The example is now running without problem.

#3

Thank you so so so so much!
you code work well, and I also change your code a bit , it also works
model_param._data = [new_value.copyto(model_param_ctx)]