code: def centralized_compute_gradient(self, batch_ctx, w, X, Y, weight):
      h = X.shape[0]
      Xw = torch.matmul(X, w.detach())
      d = Xw - Y
  
      Xw_h_all = batch_ctx.hosts.get("Xw_h")
      for Xw_h in Xw_h_all:
          d += Xw_h
  
      if weight:
          d = d * weight
      batch_ctx.hosts.put(d=d)
  
      # gradient
      if self.floating_point_precision:
          g = torch.matmul(
              torch.encode_as_int_f(X.T, self.floating_point_precision),
              d,
          )
          g = 1 / (self._fixpoint_precision * h) * g
      else:
          g = 1 / h * torch.matmul(X.T, d)
      return g
  
imports: import logging
  import torch
  from fate.arch import Context, dataframe
  from fate.ml.abc.module import HeteroModule
  from fate.ml.utils import predict_tools
  from fate.ml.utils._model_param import deserialize_param, initialize_param, serialize_param
  from fate.ml.utils._optimizer import LRScheduler, Optimizer
label_desc: Use image node_id 3 for calling the CoordinatedLinREstimatorGuest obj's underlying member method code with example usage: obj.centralized_compute_gradient(batch_ctx, w, X, Y, weight) and returns: g