cluster.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: cluster.proto
  3. package cluster
  4. import (
  5. context "context"
  6. fmt "fmt"
  7. proto "github.com/golang/protobuf/proto"
  8. grpc "google.golang.org/grpc"
  9. codes "google.golang.org/grpc/codes"
  10. status "google.golang.org/grpc/status"
  11. math "math"
  12. )
  13. // Reference imports to suppress errors if they are not otherwise used.
  14. var _ = proto.Marshal
  15. var _ = fmt.Errorf
  16. var _ = math.Inf
  17. // This is a compile-time assertion to ensure that this generated file
  18. // is compatible with the proto package it is being compiled against.
  19. // A compilation error at this line likely means your copy of the
  20. // proto package needs to be updated.
  21. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
  22. type UnitInfo struct {
  23. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
  24. AvailableThreads int32 `protobuf:"zigzag32,2,opt,name=availableThreads,proto3" json:"availableThreads,omitempty"`
  25. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  26. XXX_unrecognized []byte `json:"-"`
  27. XXX_sizecache int32 `json:"-"`
  28. }
  29. func (m *UnitInfo) Reset() { *m = UnitInfo{} }
  30. func (m *UnitInfo) String() string { return proto.CompactTextString(m) }
  31. func (*UnitInfo) ProtoMessage() {}
  32. func (*UnitInfo) Descriptor() ([]byte, []int) {
  33. return fileDescriptor_3cfb3b8ec240c376, []int{0}
  34. }
  35. func (m *UnitInfo) XXX_Unmarshal(b []byte) error {
  36. return xxx_messageInfo_UnitInfo.Unmarshal(m, b)
  37. }
  38. func (m *UnitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  39. return xxx_messageInfo_UnitInfo.Marshal(b, m, deterministic)
  40. }
  41. func (m *UnitInfo) XXX_Merge(src proto.Message) {
  42. xxx_messageInfo_UnitInfo.Merge(m, src)
  43. }
  44. func (m *UnitInfo) XXX_Size() int {
  45. return xxx_messageInfo_UnitInfo.Size(m)
  46. }
  47. func (m *UnitInfo) XXX_DiscardUnknown() {
  48. xxx_messageInfo_UnitInfo.DiscardUnknown(m)
  49. }
  50. var xxx_messageInfo_UnitInfo proto.InternalMessageInfo
  51. func (m *UnitInfo) GetUrl() string {
  52. if m != nil {
  53. return m.Url
  54. }
  55. return ""
  56. }
  57. func (m *UnitInfo) GetAvailableThreads() int32 {
  58. if m != nil {
  59. return m.AvailableThreads
  60. }
  61. return 0
  62. }
  63. type UnitInfos struct {
  64. List []*UnitInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
  65. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  66. XXX_unrecognized []byte `json:"-"`
  67. XXX_sizecache int32 `json:"-"`
  68. }
  69. func (m *UnitInfos) Reset() { *m = UnitInfos{} }
  70. func (m *UnitInfos) String() string { return proto.CompactTextString(m) }
  71. func (*UnitInfos) ProtoMessage() {}
  72. func (*UnitInfos) Descriptor() ([]byte, []int) {
  73. return fileDescriptor_3cfb3b8ec240c376, []int{1}
  74. }
  75. func (m *UnitInfos) XXX_Unmarshal(b []byte) error {
  76. return xxx_messageInfo_UnitInfos.Unmarshal(m, b)
  77. }
  78. func (m *UnitInfos) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  79. return xxx_messageInfo_UnitInfos.Marshal(b, m, deterministic)
  80. }
  81. func (m *UnitInfos) XXX_Merge(src proto.Message) {
  82. xxx_messageInfo_UnitInfos.Merge(m, src)
  83. }
  84. func (m *UnitInfos) XXX_Size() int {
  85. return xxx_messageInfo_UnitInfos.Size(m)
  86. }
  87. func (m *UnitInfos) XXX_DiscardUnknown() {
  88. xxx_messageInfo_UnitInfos.DiscardUnknown(m)
  89. }
  90. var xxx_messageInfo_UnitInfos proto.InternalMessageInfo
  91. func (m *UnitInfos) GetList() []*UnitInfo {
  92. if m != nil {
  93. return m.List
  94. }
  95. return nil
  96. }
  97. type Matrix struct {
  98. Matrix []byte `protobuf:"bytes,1,opt,name=matrix,proto3" json:"matrix,omitempty"`
  99. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  100. XXX_unrecognized []byte `json:"-"`
  101. XXX_sizecache int32 `json:"-"`
  102. }
  103. func (m *Matrix) Reset() { *m = Matrix{} }
  104. func (m *Matrix) String() string { return proto.CompactTextString(m) }
  105. func (*Matrix) ProtoMessage() {}
  106. func (*Matrix) Descriptor() ([]byte, []int) {
  107. return fileDescriptor_3cfb3b8ec240c376, []int{2}
  108. }
  109. func (m *Matrix) XXX_Unmarshal(b []byte) error {
  110. return xxx_messageInfo_Matrix.Unmarshal(m, b)
  111. }
  112. func (m *Matrix) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  113. return xxx_messageInfo_Matrix.Marshal(b, m, deterministic)
  114. }
  115. func (m *Matrix) XXX_Merge(src proto.Message) {
  116. xxx_messageInfo_Matrix.Merge(m, src)
  117. }
  118. func (m *Matrix) XXX_Size() int {
  119. return xxx_messageInfo_Matrix.Size(m)
  120. }
  121. func (m *Matrix) XXX_DiscardUnknown() {
  122. xxx_messageInfo_Matrix.DiscardUnknown(m)
  123. }
  124. var xxx_messageInfo_Matrix proto.InternalMessageInfo
  125. func (m *Matrix) GetMatrix() []byte {
  126. if m != nil {
  127. return m.Matrix
  128. }
  129. return nil
  130. }
  131. type DataSet struct {
  132. Biases []*Matrix `protobuf:"bytes,1,rep,name=biases,proto3" json:"biases,omitempty"`
  133. Weights []*Matrix `protobuf:"bytes,2,rep,name=weights,proto3" json:"weights,omitempty"`
  134. Data []*Matrix `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
  135. Result []*Matrix `protobuf:"bytes,4,rep,name=result,proto3" json:"result,omitempty"`
  136. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  137. XXX_unrecognized []byte `json:"-"`
  138. XXX_sizecache int32 `json:"-"`
  139. }
  140. func (m *DataSet) Reset() { *m = DataSet{} }
  141. func (m *DataSet) String() string { return proto.CompactTextString(m) }
  142. func (*DataSet) ProtoMessage() {}
  143. func (*DataSet) Descriptor() ([]byte, []int) {
  144. return fileDescriptor_3cfb3b8ec240c376, []int{3}
  145. }
  146. func (m *DataSet) XXX_Unmarshal(b []byte) error {
  147. return xxx_messageInfo_DataSet.Unmarshal(m, b)
  148. }
  149. func (m *DataSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  150. return xxx_messageInfo_DataSet.Marshal(b, m, deterministic)
  151. }
  152. func (m *DataSet) XXX_Merge(src proto.Message) {
  153. xxx_messageInfo_DataSet.Merge(m, src)
  154. }
  155. func (m *DataSet) XXX_Size() int {
  156. return xxx_messageInfo_DataSet.Size(m)
  157. }
  158. func (m *DataSet) XXX_DiscardUnknown() {
  159. xxx_messageInfo_DataSet.DiscardUnknown(m)
  160. }
  161. var xxx_messageInfo_DataSet proto.InternalMessageInfo
  162. func (m *DataSet) GetBiases() []*Matrix {
  163. if m != nil {
  164. return m.Biases
  165. }
  166. return nil
  167. }
  168. func (m *DataSet) GetWeights() []*Matrix {
  169. if m != nil {
  170. return m.Weights
  171. }
  172. return nil
  173. }
  174. func (m *DataSet) GetData() []*Matrix {
  175. if m != nil {
  176. return m.Data
  177. }
  178. return nil
  179. }
  180. func (m *DataSet) GetResult() []*Matrix {
  181. if m != nil {
  182. return m.Result
  183. }
  184. return nil
  185. }
  186. func init() {
  187. proto.RegisterType((*UnitInfo)(nil), "cluster.UnitInfo")
  188. proto.RegisterType((*UnitInfos)(nil), "cluster.UnitInfos")
  189. proto.RegisterType((*Matrix)(nil), "cluster.Matrix")
  190. proto.RegisterType((*DataSet)(nil), "cluster.DataSet")
  191. }
  192. func init() { proto.RegisterFile("cluster.proto", fileDescriptor_3cfb3b8ec240c376) }
  193. var fileDescriptor_3cfb3b8ec240c376 = []byte{
  194. // 290 bytes of a gzipped FileDescriptorProto
  195. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xb1, 0x4e, 0xc3, 0x30,
  196. 0x10, 0x86, 0x6b, 0x52, 0x25, 0xed, 0x01, 0x22, 0xb1, 0x10, 0x8a, 0x3a, 0x45, 0x46, 0x88, 0xd0,
  197. 0xa1, 0x42, 0x81, 0x9d, 0x01, 0x06, 0x90, 0xa0, 0x83, 0x81, 0x07, 0x70, 0xa8, 0x69, 0x2d, 0x4c,
  198. 0x82, 0xec, 0x0b, 0xe5, 0x9d, 0x78, 0x49, 0x14, 0x27, 0xa9, 0x04, 0x29, 0xdb, 0xdd, 0x7d, 0xbf,
  199. 0xff, 0xff, 0x74, 0x86, 0xfd, 0x17, 0x5d, 0x59, 0x94, 0x66, 0xf6, 0x61, 0x4a, 0x2c, 0x69, 0xd0,
  200. 0xb6, 0xec, 0x16, 0x46, 0xcf, 0x85, 0xc2, 0xbb, 0xe2, 0xb5, 0xa4, 0x21, 0x78, 0x95, 0xd1, 0x31,
  201. 0x49, 0x48, 0x3a, 0xe6, 0x75, 0x49, 0xa7, 0x10, 0x8a, 0x4f, 0xa1, 0xb4, 0xc8, 0xb5, 0x7c, 0x5a,
  202. 0x19, 0x29, 0x16, 0x36, 0xde, 0x49, 0x48, 0x1a, 0xf1, 0xde, 0x9c, 0x65, 0x30, 0xee, 0x9c, 0x2c,
  203. 0x3d, 0x81, 0xa1, 0x56, 0x16, 0x63, 0x92, 0x78, 0xe9, 0x6e, 0x16, 0xcd, 0xba, 0xf4, 0x4e, 0xc1,
  204. 0x1d, 0x66, 0x09, 0xf8, 0x0f, 0x02, 0x8d, 0xfa, 0xa2, 0x47, 0xe0, 0xbf, 0xbb, 0xca, 0xc5, 0xef,
  205. 0xf1, 0xb6, 0x63, 0xdf, 0x04, 0x82, 0x1b, 0x81, 0xe2, 0x51, 0x22, 0x3d, 0x05, 0x3f, 0x57, 0xc2,
  206. 0x4a, 0xdb, 0xda, 0x1e, 0x6c, 0x6c, 0x1b, 0x13, 0xde, 0x62, 0x7a, 0x06, 0xc1, 0x5a, 0xaa, 0xe5,
  207. 0x0a, 0xeb, 0x6d, 0xb7, 0x2a, 0x3b, 0x4e, 0x8f, 0x61, 0xb8, 0x10, 0x28, 0x62, 0x6f, 0xbb, 0xce,
  208. 0xc1, 0x3a, 0xd8, 0x48, 0x5b, 0x69, 0x8c, 0x87, 0xff, 0x04, 0x37, 0x38, 0xbb, 0x87, 0xc3, 0xb9,
  209. 0xac, 0x8c, 0xd0, 0x73, 0x89, 0xeb, 0xd2, 0xbc, 0x5d, 0x37, 0x32, 0x7a, 0x09, 0x23, 0x2e, 0x97,
  210. 0xca, 0xd5, 0xfd, 0x63, 0x4c, 0xfa, 0x23, 0x36, 0x38, 0x27, 0xd9, 0x15, 0x44, 0xbf, 0xdc, 0x6a,
  211. 0x48, 0xa7, 0xe0, 0xf1, 0xaa, 0xa0, 0xe1, 0xe6, 0x49, 0x7b, 0x9d, 0xc9, 0xdf, 0xa5, 0xd8, 0x20,
  212. 0xf7, 0xdd, 0x67, 0x5f, 0xfc, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa9, 0xdf, 0x40, 0x3f, 0xfd, 0x01,
  213. 0x00, 0x00,
  214. }
  215. // Reference imports to suppress errors if they are not otherwise used.
  216. var _ context.Context
  217. var _ grpc.ClientConnInterface
  218. // This is a compile-time assertion to ensure that this generated file
  219. // is compatible with the grpc package it is being compiled against.
  220. const _ = grpc.SupportPackageIsVersion6
  221. // NeuralNetworkClusterClient is the client API for NeuralNetworkCluster service.
  222. //
  223. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  224. type NeuralNetworkClusterClient interface {
  225. Register(ctx context.Context, in *UnitInfo, opts ...grpc.CallOption) (NeuralNetworkCluster_RegisterClient, error)
  226. }
  227. type neuralNetworkClusterClient struct {
  228. cc grpc.ClientConnInterface
  229. }
  230. func NewNeuralNetworkClusterClient(cc grpc.ClientConnInterface) NeuralNetworkClusterClient {
  231. return &neuralNetworkClusterClient{cc}
  232. }
  233. func (c *neuralNetworkClusterClient) Register(ctx context.Context, in *UnitInfo, opts ...grpc.CallOption) (NeuralNetworkCluster_RegisterClient, error) {
  234. stream, err := c.cc.NewStream(ctx, &_NeuralNetworkCluster_serviceDesc.Streams[0], "/cluster.NeuralNetworkCluster/Register", opts...)
  235. if err != nil {
  236. return nil, err
  237. }
  238. x := &neuralNetworkClusterRegisterClient{stream}
  239. if err := x.ClientStream.SendMsg(in); err != nil {
  240. return nil, err
  241. }
  242. if err := x.ClientStream.CloseSend(); err != nil {
  243. return nil, err
  244. }
  245. return x, nil
  246. }
  247. type NeuralNetworkCluster_RegisterClient interface {
  248. Recv() (*UnitInfo, error)
  249. grpc.ClientStream
  250. }
  251. type neuralNetworkClusterRegisterClient struct {
  252. grpc.ClientStream
  253. }
  254. func (x *neuralNetworkClusterRegisterClient) Recv() (*UnitInfo, error) {
  255. m := new(UnitInfo)
  256. if err := x.ClientStream.RecvMsg(m); err != nil {
  257. return nil, err
  258. }
  259. return m, nil
  260. }
  261. // NeuralNetworkClusterServer is the server API for NeuralNetworkCluster service.
  262. type NeuralNetworkClusterServer interface {
  263. Register(*UnitInfo, NeuralNetworkCluster_RegisterServer) error
  264. }
  265. // UnimplementedNeuralNetworkClusterServer can be embedded to have forward compatible implementations.
  266. type UnimplementedNeuralNetworkClusterServer struct {
  267. }
  268. func (*UnimplementedNeuralNetworkClusterServer) Register(req *UnitInfo, srv NeuralNetworkCluster_RegisterServer) error {
  269. return status.Errorf(codes.Unimplemented, "method Register not implemented")
  270. }
  271. func RegisterNeuralNetworkClusterServer(s *grpc.Server, srv NeuralNetworkClusterServer) {
  272. s.RegisterService(&_NeuralNetworkCluster_serviceDesc, srv)
  273. }
  274. func _NeuralNetworkCluster_Register_Handler(srv interface{}, stream grpc.ServerStream) error {
  275. m := new(UnitInfo)
  276. if err := stream.RecvMsg(m); err != nil {
  277. return err
  278. }
  279. return srv.(NeuralNetworkClusterServer).Register(m, &neuralNetworkClusterRegisterServer{stream})
  280. }
  281. type NeuralNetworkCluster_RegisterServer interface {
  282. Send(*UnitInfo) error
  283. grpc.ServerStream
  284. }
  285. type neuralNetworkClusterRegisterServer struct {
  286. grpc.ServerStream
  287. }
  288. func (x *neuralNetworkClusterRegisterServer) Send(m *UnitInfo) error {
  289. return x.ServerStream.SendMsg(m)
  290. }
  291. var _NeuralNetworkCluster_serviceDesc = grpc.ServiceDesc{
  292. ServiceName: "cluster.NeuralNetworkCluster",
  293. HandlerType: (*NeuralNetworkClusterServer)(nil),
  294. Methods: []grpc.MethodDesc{},
  295. Streams: []grpc.StreamDesc{
  296. {
  297. StreamName: "Register",
  298. Handler: _NeuralNetworkCluster_Register_Handler,
  299. ServerStreams: true,
  300. },
  301. },
  302. Metadata: "cluster.proto",
  303. }
  304. // NeuralNetworkUnitClient is the client API for NeuralNetworkUnit service.
  305. //
  306. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  307. type NeuralNetworkUnitClient interface {
  308. Run(ctx context.Context, in *DataSet, opts ...grpc.CallOption) (*Matrix, error)
  309. }
  310. type neuralNetworkUnitClient struct {
  311. cc grpc.ClientConnInterface
  312. }
  313. func NewNeuralNetworkUnitClient(cc grpc.ClientConnInterface) NeuralNetworkUnitClient {
  314. return &neuralNetworkUnitClient{cc}
  315. }
  316. func (c *neuralNetworkUnitClient) Run(ctx context.Context, in *DataSet, opts ...grpc.CallOption) (*Matrix, error) {
  317. out := new(Matrix)
  318. err := c.cc.Invoke(ctx, "/cluster.NeuralNetworkUnit/Run", in, out, opts...)
  319. if err != nil {
  320. return nil, err
  321. }
  322. return out, nil
  323. }
  324. // NeuralNetworkUnitServer is the server API for NeuralNetworkUnit service.
  325. type NeuralNetworkUnitServer interface {
  326. Run(context.Context, *DataSet) (*Matrix, error)
  327. }
  328. // UnimplementedNeuralNetworkUnitServer can be embedded to have forward compatible implementations.
  329. type UnimplementedNeuralNetworkUnitServer struct {
  330. }
  331. func (*UnimplementedNeuralNetworkUnitServer) Run(ctx context.Context, req *DataSet) (*Matrix, error) {
  332. return nil, status.Errorf(codes.Unimplemented, "method Run not implemented")
  333. }
  334. func RegisterNeuralNetworkUnitServer(s *grpc.Server, srv NeuralNetworkUnitServer) {
  335. s.RegisterService(&_NeuralNetworkUnit_serviceDesc, srv)
  336. }
  337. func _NeuralNetworkUnit_Run_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  338. in := new(DataSet)
  339. if err := dec(in); err != nil {
  340. return nil, err
  341. }
  342. if interceptor == nil {
  343. return srv.(NeuralNetworkUnitServer).Run(ctx, in)
  344. }
  345. info := &grpc.UnaryServerInfo{
  346. Server: srv,
  347. FullMethod: "/cluster.NeuralNetworkUnit/Run",
  348. }
  349. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  350. return srv.(NeuralNetworkUnitServer).Run(ctx, req.(*DataSet))
  351. }
  352. return interceptor(ctx, in, info, handler)
  353. }
  354. var _NeuralNetworkUnit_serviceDesc = grpc.ServiceDesc{
  355. ServiceName: "cluster.NeuralNetworkUnit",
  356. HandlerType: (*NeuralNetworkUnitServer)(nil),
  357. Methods: []grpc.MethodDesc{
  358. {
  359. MethodName: "Run",
  360. Handler: _NeuralNetworkUnit_Run_Handler,
  361. },
  362. },
  363. Streams: []grpc.StreamDesc{},
  364. Metadata: "cluster.proto",
  365. }