code: def get_gradients(self) -> Dict[str, List[mx.nd.NDArray]]:
          
          # We may have None if not all parameters are optimized
          return {"dev_%d_%s" % (i, name): exe.grad_arrays[j] for i, exe in enumerate(self.executors) for j, name in
                  enumerate(self.executor_group.arg_names)
                  if name in self.executor_group.param_names and self.executors[0].grad_arrays[j] is not None}
docs: Returns a mapping of parameters names to gradient arrays. Parameter names are prefixed with the device.