1 # Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 # ============================================================================== 15 # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 16 # 17 # Do not use pylint on generated code. 18 # pylint: disable=missing-docstring,g-short-docstring-punctuation,g-no-space-after-docstring-summary,invalid-name,line-too-long,unused-argument,g-doc-args 19 from __future__ import absolute_import 20 from __future__ import division 21 from __future__ import print_function 22 23 import grpc 24 25 from tensorflow.core.debug import debug_service_pb2 as tensorflow_dot_core_dot_debug_dot_debug__service__pb2 26 from tensorflow.core.protobuf import debug_pb2 as tensorflow_dot_core_dot_protobuf_dot_debug__pb2 27 from tensorflow.core.util import event_pb2 as tensorflow_dot_core_dot_util_dot_event__pb2 28 29 30 class EventListenerStub(object): 31 """EventListener: Receives Event protos, e.g., from debugged TensorFlow 32 runtime(s). 33 """ 34 35 def __init__(self, channel): 36 """Constructor. 37 38 Args: 39 channel: A grpc.Channel. 40 """ 41 self.SendEvents = channel.stream_stream( 42 '/tensorflow.EventListener/SendEvents', 43 request_serializer=tensorflow_dot_core_dot_util_dot_event__pb2.Event.SerializeToString, 44 response_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.FromString, 45 ) 46 self.SendTracebacks = channel.unary_unary( 47 '/tensorflow.EventListener/SendTracebacks', 48 request_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.CallTraceback.SerializeToString, 49 response_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.FromString, 50 ) 51 self.SendSourceFiles = channel.unary_unary( 52 '/tensorflow.EventListener/SendSourceFiles', 53 request_serializer=tensorflow_dot_core_dot_protobuf_dot_debug__pb2.DebuggedSourceFiles.SerializeToString, 54 response_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.FromString, 55 ) 56 57 58 class EventListenerServicer(object): 59 """EventListener: Receives Event protos, e.g., from debugged TensorFlow 60 runtime(s). 61 """ 62 63 def SendEvents(self, request_iterator, context): 64 """Client(s) can use this RPC method to send the EventListener Event protos. 65 The Event protos can hold information such as: 66 1) intermediate tensors from a debugged graph being executed, which can 67 be sent from DebugIdentity ops configured with grpc URLs. 68 2) GraphDefs of partition graphs, which can be sent from special debug 69 ops that get executed immediately after the beginning of the graph 70 execution. 71 """ 72 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 73 context.set_details('Method not implemented!') 74 raise NotImplementedError('Method not implemented!') 75 76 def SendTracebacks(self, request, context): 77 """Send the tracebacks of ops in a Python graph definition. 78 """ 79 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 80 context.set_details('Method not implemented!') 81 raise NotImplementedError('Method not implemented!') 82 83 def SendSourceFiles(self, request, context): 84 """Send a collection of source code files being debugged. 85 """ 86 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 87 context.set_details('Method not implemented!') 88 raise NotImplementedError('Method not implemented!') 89 90 91 def add_EventListenerServicer_to_server(servicer, server): 92 rpc_method_handlers = { 93 'SendEvents': grpc.stream_stream_rpc_method_handler( 94 servicer.SendEvents, 95 request_deserializer=tensorflow_dot_core_dot_util_dot_event__pb2.Event.FromString, 96 response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString, 97 ), 98 'SendTracebacks': grpc.unary_unary_rpc_method_handler( 99 servicer.SendTracebacks, 100 request_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.CallTraceback.FromString, 101 response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString, 102 ), 103 'SendSourceFiles': grpc.unary_unary_rpc_method_handler( 104 servicer.SendSourceFiles, 105 request_deserializer=tensorflow_dot_core_dot_protobuf_dot_debug__pb2.DebuggedSourceFiles.FromString, 106 response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString, 107 ), 108 } 109 generic_handler = grpc.method_handlers_generic_handler( 110 'tensorflow.EventListener', rpc_method_handlers) 111 server.add_generic_rpc_handlers((generic_handler,)) 112