parameters: (left_send, recv_part, local_part, allreduce, parameter_divisibility, allreduce_node_num)
return_statement: return res
docstring: send result and receive result.
docstring_summary: send result and receive result.
docstring_tokens: send result and receive result .
function: def _send_recv_res(left_send, recv_part, local_part, allreduce, parameter_divisibility, allreduce_node_num):
      """send result and receive result."""
      if parameter_divisibility:
          recv_part = P.Squeeze()(recv_part)
          local_part = F.depend(local_part, recv_part)
          eps = 1e-12
          value_0 = P.ReduceSum()(local_part * recv_part) + eps
          if left_send:
              value_1 = P.ReduceSum()(local_part * local_part) + eps
              value_2 = P.ReduceSum()(recv_part * recv_part) + eps
          else:
              value_1 = P.ReduceSum()(recv_part * recv_part) + eps
              value_2 = P.ReduceSum()(local_part * local_part) + eps
          value_0 = allreduce(value_0)
          value_1 = F.depend(allreduce(value_1), value_0)
          value_2 = F.depend(allreduce(value_2), value_1)
          if left_send:
              res = (1 - (value_0 / (2 * value_1))) * local_part + (1 - (value_0 / (2 * value_2))) * recv_part
          else:
              res = (1 - (value_0 / (2 * value_1))) * recv_part + (1 - (value_0 / (2 * value_2))) * local_part
      else:
          res = allreduce(local_part)
          res /= allreduce_node_num
      return res
function_tokens: def _send_recv_res ( left_send , recv_part , local_part , allreduce , parameter_divisibility , allreduce_node_num ) : if parameter_divisibility : recv_part = P . Squeeze ( ) ( recv_part ) local_part = F . depend ( local_part , recv_part ) eps = 1e-12 value_0 = P . ReduceSum ( ) ( local_part * recv_part ) + eps if left_send : value_1 = P . ReduceSum ( ) ( local_part * local_part ) + eps value_2 = P . ReduceSum ( ) ( recv_part * recv_part ) + eps else : value_1 = P . ReduceSum ( ) ( recv_part * recv_part ) + eps value_2 = P . ReduceSum ( ) ( local_part * local_part ) + eps value_0 = allreduce ( value_0 ) value_1 = F . depend ( allreduce ( value_1 ) , value_0 ) value_2 = F . depend ( allreduce ( value_2 ) , value_1 ) if left_send : res = ( 1 - ( value_0 / ( 2 * value_1 ) ) ) * local_part + ( 1 - ( value_0 / ( 2 * value_2 ) ) ) * recv_part else : res = ( 1 - ( value_0 / ( 2 * value_1 ) ) ) * recv_part + ( 1 - ( value_0 / ( 2 * value_2 ) ) ) * local_part else : res = allreduce ( local_part ) res /= allreduce_node_num return res