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 19import grpc 20 21from tensorflow.core.debug import debug_service_pb2 as tensorflow_dot_core_dot_debug_dot_debug__service__pb2 22from tensorflow.core.protobuf import debug_pb2 as tensorflow_dot_core_dot_protobuf_dot_debug__pb2 23from tensorflow.core.util import event_pb2 as tensorflow_dot_core_dot_util_dot_event__pb2 24 25 26class EventListenerStub(object): 27 """EventListener: Receives Event protos, e.g., from debugged TensorFlow 28 runtime(s). 29 """ 30 31 def __init__(self, channel): 32 """Constructor. 33 34 Args: 35 channel: A grpc.Channel. 36 """ 37 self.SendEvents = channel.stream_stream( 38 '/tensorflow.EventListener/SendEvents', 39 request_serializer=tensorflow_dot_core_dot_util_dot_event__pb2.Event.SerializeToString, 40 response_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.FromString, 41 ) 42 self.SendTracebacks = channel.unary_unary( 43 '/tensorflow.EventListener/SendTracebacks', 44 request_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.CallTraceback.SerializeToString, 45 response_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.FromString, 46 ) 47 self.SendSourceFiles = channel.unary_unary( 48 '/tensorflow.EventListener/SendSourceFiles', 49 request_serializer=tensorflow_dot_core_dot_protobuf_dot_debug__pb2.DebuggedSourceFiles.SerializeToString, 50 response_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.FromString, 51 ) 52 53 54class EventListenerServicer(object): 55 """EventListener: Receives Event protos, e.g., from debugged TensorFlow 56 runtime(s). 57 """ 58 59 def SendEvents(self, request_iterator, context): 60 """Client(s) can use this RPC method to send the EventListener Event protos. 61 The Event protos can hold information such as: 62 1) intermediate tensors from a debugged graph being executed, which can 63 be sent from DebugIdentity ops configured with grpc URLs. 64 2) GraphDefs of partition graphs, which can be sent from special debug 65 ops that get executed immediately after the beginning of the graph 66 execution. 67 """ 68 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 69 context.set_details('Method not implemented!') 70 raise NotImplementedError('Method not implemented!') 71 72 def SendTracebacks(self, request, context): 73 """Send the tracebacks of ops in a Python graph definition. 74 """ 75 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 76 context.set_details('Method not implemented!') 77 raise NotImplementedError('Method not implemented!') 78 79 def SendSourceFiles(self, request, context): 80 """Send a collection of source code files being debugged. 81 """ 82 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 83 context.set_details('Method not implemented!') 84 raise NotImplementedError('Method not implemented!') 85 86 87def add_EventListenerServicer_to_server(servicer, server): 88 rpc_method_handlers = { 89 'SendEvents': grpc.stream_stream_rpc_method_handler( 90 servicer.SendEvents, 91 request_deserializer=tensorflow_dot_core_dot_util_dot_event__pb2.Event.FromString, 92 response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString, 93 ), 94 'SendTracebacks': grpc.unary_unary_rpc_method_handler( 95 servicer.SendTracebacks, 96 request_deserializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.CallTraceback.FromString, 97 response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString, 98 ), 99 'SendSourceFiles': grpc.unary_unary_rpc_method_handler( 100 servicer.SendSourceFiles, 101 request_deserializer=tensorflow_dot_core_dot_protobuf_dot_debug__pb2.DebuggedSourceFiles.FromString, 102 response_serializer=tensorflow_dot_core_dot_debug_dot_debug__service__pb2.EventReply.SerializeToString, 103 ), 104 } 105 generic_handler = grpc.method_handlers_generic_handler( 106 'tensorflow.EventListener', rpc_method_handlers) 107 server.add_generic_rpc_handlers((generic_handler,)) 108