# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

import neural_nets_pb2 as neural__nets__pb2


class LayerDataExchangeStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.UpdateInput = channel.unary_unary(
        '/nn.LayerDataExchange/UpdateInput',
        request_serializer=neural__nets__pb2.ForwardMsg.SerializeToString,
        response_deserializer=neural__nets__pb2.PlainResponse.FromString,
        )
    self.UpdateDelta = channel.unary_unary(
        '/nn.LayerDataExchange/UpdateDelta',
        request_serializer=neural__nets__pb2.BackwardMsg.SerializeToString,
        response_deserializer=neural__nets__pb2.PlainResponse.FromString,
        )


class LayerDataExchangeServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def UpdateInput(self, request, context):
    """invoked by lower layer
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def UpdateDelta(self, request, context):
    """backward deltas; invoked by upper layer to pass through error delta
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_LayerDataExchangeServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'UpdateInput': grpc.unary_unary_rpc_method_handler(
          servicer.UpdateInput,
          request_deserializer=neural__nets__pb2.ForwardMsg.FromString,
          response_serializer=neural__nets__pb2.PlainResponse.SerializeToString,
      ),
      'UpdateDelta': grpc.unary_unary_rpc_method_handler(
          servicer.UpdateDelta,
          request_deserializer=neural__nets__pb2.BackwardMsg.FromString,
          response_serializer=neural__nets__pb2.PlainResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'nn.LayerDataExchange', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
