docstr: Get the loss data from FLServer and construct the identical Pytorch Tensor
docstr_tok: ["Get","the","loss","data","from","FLServer","and","construct","the","identical","Pytorch","Tensor"]
code: def train_step(self, x, y):
      """
      Get the loss data from FLServer and construct the identical Pytorch Tensor
      """
      y_pred_local = self.model(x)
      y_true_global = y
      data_map = {"input": y_pred_local.detach().numpy()}
      if y_true_global is not None:
          data_map["target"] = y_true_global.detach().numpy()
      logging.debug(
          f"[{self.fl_client.client_uuid}] client sending train data to server"
      )
      response = self.fl_client.train(data_map)
      logging.debug(
          f"[{self.fl_client.client_uuid}] client got response from server"
      )
      response_map = tensor_map_to_ndarray_map(response.data.tensorMap)
      grad = response_map["grad"]
      self.optimizer.zero_grad()
      y_pred_local.backward(gradient=torch.tensor(grad))
      self.optimizer.step()
      return response_map["loss"]
  
imports: import logging
  from numpy import ndarray
  import torch
  from torch import nn
  from bigdl.ppml.fl.nn.fl_client import FLClient
  from torch.utils.data import DataLoader
  from bigdl.dllib.utils.log4Error import invalidInputError, invalidOperationError
  from bigdl.ppml.fl.nn.nn_client import NNClient
  from bigdl.ppml.fl.nn.utils import file_chunk_generate, tensor_map_to_ndarray_map
  import os
  import tempfile
  from nn_service_pb2 import LoadModelRequest, SaveModelRequest
label_desc: Use image node_id 6 for calling the PytorchEstimator obj's underlying member method code with example usage: obj.train_step(x, y) and returns: response_map