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

from tensorflow.contrib.tpu.profiler import tpu_profiler_pb2 as tensorflow_dot_contrib_dot_tpu_dot_profiler_dot_tpu__profiler__pb2


class TPUProfilerStub(object):
  """The TPUProfiler service retrieves performance information about
  the programs running on connected TPUs over a period of time.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.Profile = channel.unary_unary(
        '/tensorflow.TPUProfiler/Profile',
        request_serializer=tensorflow_dot_contrib_dot_tpu_dot_profiler_dot_tpu__profiler__pb2.ProfileRequest.SerializeToString,
        response_deserializer=tensorflow_dot_contrib_dot_tpu_dot_profiler_dot_tpu__profiler__pb2.ProfileResponse.FromString,
        )


class TPUProfilerServicer(object):
  """The TPUProfiler service retrieves performance information about
  the programs running on connected TPUs over a period of time.
  """

  def Profile(self, request, context):
    """Starts a profiling session, blocks until it completes, and returns data.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_TPUProfilerServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Profile': grpc.unary_unary_rpc_method_handler(
          servicer.Profile,
          request_deserializer=tensorflow_dot_contrib_dot_tpu_dot_profiler_dot_tpu__profiler__pb2.ProfileRequest.FromString,
          response_serializer=tensorflow_dot_contrib_dot_tpu_dot_profiler_dot_tpu__profiler__pb2.ProfileResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'tensorflow.TPUProfiler', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
