// DO NOT EDIT.
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: tensorflow/core/framework/graph_transfer_info.proto
//
// For information on using the generated types, please see the documenation:
//   https://github.com/apple/swift-protobuf/

import Foundation
import SwiftProtobuf

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that your are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  typealias Version = _2
}

public struct Tensorflow_GraphTransferNodeInput {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  public var nodeID: Int32 = 0

  public var outputPort: Int32 = 0

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

public struct Tensorflow_GraphTransferNodeInfo {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  public var name: String = String()

  public var nodeID: Int32 = 0

  public var typeName: String = String()

  public var socOpID: Int32 = 0

  public var paddingID: Int32 = 0

  public var inputCount: Int32 = 0

  public var outputCount: Int32 = 0

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

public struct Tensorflow_GraphTransferConstNodeInfo {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  public var name: String = String()

  public var nodeID: Int32 = 0

  public var shape: [Int64] = []

  public var data: Data = SwiftProtobuf.Internal.emptyData

  public var dtype: Tensorflow_DataType = .dtInvalid

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

public struct Tensorflow_GraphTransferNodeInputInfo {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  public var nodeID: Int32 = 0

  public var nodeInput: [Tensorflow_GraphTransferNodeInput] = []

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

public struct Tensorflow_GraphTransferNodeOutputInfo {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  public var nodeID: Int32 = 0

  public var maxByteSize: [Int32] = []

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

public struct Tensorflow_GraphTransferGraphInputNodeInfo {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  public var name: String = String()

  public var shape: [Int64] = []

  public var dtype: Tensorflow_DataType = .dtInvalid

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

public struct Tensorflow_GraphTransferGraphOutputNodeInfo {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  public var name: String = String()

  public var shape: [Int64] = []

  public var dtype: Tensorflow_DataType = .dtInvalid

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

/// Protocol buffer representing a handle to a tensorflow resource. Handles are
/// not valid across executions, but can be serialized back and forth from within
/// a single run.
public struct Tensorflow_GraphTransferInfo {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  public var nodeInfo: [Tensorflow_GraphTransferNodeInfo] = []

  public var constNodeInfo: [Tensorflow_GraphTransferConstNodeInfo] = []

  public var nodeInputInfo: [Tensorflow_GraphTransferNodeInputInfo] = []

  public var nodeOutputInfo: [Tensorflow_GraphTransferNodeOutputInfo] = []

  /// Input Node parameters of transferred graph
  public var graphInputNodeInfo: [Tensorflow_GraphTransferGraphInputNodeInfo] = []

  public var graphOutputNodeInfo: [Tensorflow_GraphTransferGraphOutputNodeInfo] = []

  /// Destination of graph transfer
  public var destination: Tensorflow_GraphTransferInfo.Destination = .nop

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public enum Destination: SwiftProtobuf.Enum {
    public typealias RawValue = Int
    case nop // = 0
    case hexagon // = 1
    case UNRECOGNIZED(Int)

    public init() {
      self = .nop
    }

    public init?(rawValue: Int) {
      switch rawValue {
      case 0: self = .nop
      case 1: self = .hexagon
      default: self = .UNRECOGNIZED(rawValue)
      }
    }

    public var rawValue: Int {
      switch self {
      case .nop: return 0
      case .hexagon: return 1
      case .UNRECOGNIZED(let i): return i
      }
    }

  }

  public init() {}
}

#if swift(>=4.2)

extension Tensorflow_GraphTransferInfo.Destination: CaseIterable {
  // The compiler won't synthesize support with the UNRECOGNIZED case.
  public static var allCases: [Tensorflow_GraphTransferInfo.Destination] = [
    .nop,
    .hexagon,
  ]
}

#endif  // swift(>=4.2)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "tensorflow"

extension Tensorflow_GraphTransferNodeInput: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".GraphTransferNodeInput"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "node_id"),
    2: .standard(proto: "output_port"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularInt32Field(value: &self.nodeID)
      case 2: try decoder.decodeSingularInt32Field(value: &self.outputPort)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.nodeID != 0 {
      try visitor.visitSingularInt32Field(value: self.nodeID, fieldNumber: 1)
    }
    if self.outputPort != 0 {
      try visitor.visitSingularInt32Field(value: self.outputPort, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Tensorflow_GraphTransferNodeInput, rhs: Tensorflow_GraphTransferNodeInput) -> Bool {
    if lhs.nodeID != rhs.nodeID {return false}
    if lhs.outputPort != rhs.outputPort {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Tensorflow_GraphTransferNodeInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".GraphTransferNodeInfo"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "name"),
    2: .standard(proto: "node_id"),
    3: .standard(proto: "type_name"),
    4: .standard(proto: "soc_op_id"),
    5: .standard(proto: "padding_id"),
    6: .standard(proto: "input_count"),
    7: .standard(proto: "output_count"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.name)
      case 2: try decoder.decodeSingularInt32Field(value: &self.nodeID)
      case 3: try decoder.decodeSingularStringField(value: &self.typeName)
      case 4: try decoder.decodeSingularInt32Field(value: &self.socOpID)
      case 5: try decoder.decodeSingularInt32Field(value: &self.paddingID)
      case 6: try decoder.decodeSingularInt32Field(value: &self.inputCount)
      case 7: try decoder.decodeSingularInt32Field(value: &self.outputCount)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.name.isEmpty {
      try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
    }
    if self.nodeID != 0 {
      try visitor.visitSingularInt32Field(value: self.nodeID, fieldNumber: 2)
    }
    if !self.typeName.isEmpty {
      try visitor.visitSingularStringField(value: self.typeName, fieldNumber: 3)
    }
    if self.socOpID != 0 {
      try visitor.visitSingularInt32Field(value: self.socOpID, fieldNumber: 4)
    }
    if self.paddingID != 0 {
      try visitor.visitSingularInt32Field(value: self.paddingID, fieldNumber: 5)
    }
    if self.inputCount != 0 {
      try visitor.visitSingularInt32Field(value: self.inputCount, fieldNumber: 6)
    }
    if self.outputCount != 0 {
      try visitor.visitSingularInt32Field(value: self.outputCount, fieldNumber: 7)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Tensorflow_GraphTransferNodeInfo, rhs: Tensorflow_GraphTransferNodeInfo) -> Bool {
    if lhs.name != rhs.name {return false}
    if lhs.nodeID != rhs.nodeID {return false}
    if lhs.typeName != rhs.typeName {return false}
    if lhs.socOpID != rhs.socOpID {return false}
    if lhs.paddingID != rhs.paddingID {return false}
    if lhs.inputCount != rhs.inputCount {return false}
    if lhs.outputCount != rhs.outputCount {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Tensorflow_GraphTransferConstNodeInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".GraphTransferConstNodeInfo"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "name"),
    2: .standard(proto: "node_id"),
    3: .same(proto: "shape"),
    4: .same(proto: "data"),
    5: .same(proto: "dtype"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.name)
      case 2: try decoder.decodeSingularInt32Field(value: &self.nodeID)
      case 3: try decoder.decodeRepeatedInt64Field(value: &self.shape)
      case 4: try decoder.decodeSingularBytesField(value: &self.data)
      case 5: try decoder.decodeSingularEnumField(value: &self.dtype)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.name.isEmpty {
      try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
    }
    if self.nodeID != 0 {
      try visitor.visitSingularInt32Field(value: self.nodeID, fieldNumber: 2)
    }
    if !self.shape.isEmpty {
      try visitor.visitPackedInt64Field(value: self.shape, fieldNumber: 3)
    }
    if !self.data.isEmpty {
      try visitor.visitSingularBytesField(value: self.data, fieldNumber: 4)
    }
    if self.dtype != .dtInvalid {
      try visitor.visitSingularEnumField(value: self.dtype, fieldNumber: 5)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Tensorflow_GraphTransferConstNodeInfo, rhs: Tensorflow_GraphTransferConstNodeInfo) -> Bool {
    if lhs.name != rhs.name {return false}
    if lhs.nodeID != rhs.nodeID {return false}
    if lhs.shape != rhs.shape {return false}
    if lhs.data != rhs.data {return false}
    if lhs.dtype != rhs.dtype {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Tensorflow_GraphTransferNodeInputInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".GraphTransferNodeInputInfo"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "node_id"),
    2: .standard(proto: "node_input"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularInt32Field(value: &self.nodeID)
      case 2: try decoder.decodeRepeatedMessageField(value: &self.nodeInput)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.nodeID != 0 {
      try visitor.visitSingularInt32Field(value: self.nodeID, fieldNumber: 1)
    }
    if !self.nodeInput.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.nodeInput, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Tensorflow_GraphTransferNodeInputInfo, rhs: Tensorflow_GraphTransferNodeInputInfo) -> Bool {
    if lhs.nodeID != rhs.nodeID {return false}
    if lhs.nodeInput != rhs.nodeInput {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Tensorflow_GraphTransferNodeOutputInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".GraphTransferNodeOutputInfo"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "node_id"),
    2: .standard(proto: "max_byte_size"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularInt32Field(value: &self.nodeID)
      case 2: try decoder.decodeRepeatedInt32Field(value: &self.maxByteSize)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.nodeID != 0 {
      try visitor.visitSingularInt32Field(value: self.nodeID, fieldNumber: 1)
    }
    if !self.maxByteSize.isEmpty {
      try visitor.visitPackedInt32Field(value: self.maxByteSize, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Tensorflow_GraphTransferNodeOutputInfo, rhs: Tensorflow_GraphTransferNodeOutputInfo) -> Bool {
    if lhs.nodeID != rhs.nodeID {return false}
    if lhs.maxByteSize != rhs.maxByteSize {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Tensorflow_GraphTransferGraphInputNodeInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".GraphTransferGraphInputNodeInfo"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "name"),
    2: .same(proto: "shape"),
    3: .same(proto: "dtype"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.name)
      case 2: try decoder.decodeRepeatedInt64Field(value: &self.shape)
      case 3: try decoder.decodeSingularEnumField(value: &self.dtype)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.name.isEmpty {
      try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
    }
    if !self.shape.isEmpty {
      try visitor.visitPackedInt64Field(value: self.shape, fieldNumber: 2)
    }
    if self.dtype != .dtInvalid {
      try visitor.visitSingularEnumField(value: self.dtype, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Tensorflow_GraphTransferGraphInputNodeInfo, rhs: Tensorflow_GraphTransferGraphInputNodeInfo) -> Bool {
    if lhs.name != rhs.name {return false}
    if lhs.shape != rhs.shape {return false}
    if lhs.dtype != rhs.dtype {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Tensorflow_GraphTransferGraphOutputNodeInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".GraphTransferGraphOutputNodeInfo"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "name"),
    2: .same(proto: "shape"),
    3: .same(proto: "dtype"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.name)
      case 2: try decoder.decodeRepeatedInt64Field(value: &self.shape)
      case 3: try decoder.decodeSingularEnumField(value: &self.dtype)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.name.isEmpty {
      try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
    }
    if !self.shape.isEmpty {
      try visitor.visitPackedInt64Field(value: self.shape, fieldNumber: 2)
    }
    if self.dtype != .dtInvalid {
      try visitor.visitSingularEnumField(value: self.dtype, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Tensorflow_GraphTransferGraphOutputNodeInfo, rhs: Tensorflow_GraphTransferGraphOutputNodeInfo) -> Bool {
    if lhs.name != rhs.name {return false}
    if lhs.shape != rhs.shape {return false}
    if lhs.dtype != rhs.dtype {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Tensorflow_GraphTransferInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".GraphTransferInfo"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "node_info"),
    2: .standard(proto: "const_node_info"),
    3: .standard(proto: "node_input_info"),
    4: .standard(proto: "node_output_info"),
    5: .standard(proto: "graph_input_node_info"),
    6: .standard(proto: "graph_output_node_info"),
    7: .same(proto: "destination"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeRepeatedMessageField(value: &self.nodeInfo)
      case 2: try decoder.decodeRepeatedMessageField(value: &self.constNodeInfo)
      case 3: try decoder.decodeRepeatedMessageField(value: &self.nodeInputInfo)
      case 4: try decoder.decodeRepeatedMessageField(value: &self.nodeOutputInfo)
      case 5: try decoder.decodeRepeatedMessageField(value: &self.graphInputNodeInfo)
      case 6: try decoder.decodeRepeatedMessageField(value: &self.graphOutputNodeInfo)
      case 7: try decoder.decodeSingularEnumField(value: &self.destination)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.nodeInfo.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.nodeInfo, fieldNumber: 1)
    }
    if !self.constNodeInfo.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.constNodeInfo, fieldNumber: 2)
    }
    if !self.nodeInputInfo.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.nodeInputInfo, fieldNumber: 3)
    }
    if !self.nodeOutputInfo.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.nodeOutputInfo, fieldNumber: 4)
    }
    if !self.graphInputNodeInfo.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.graphInputNodeInfo, fieldNumber: 5)
    }
    if !self.graphOutputNodeInfo.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.graphOutputNodeInfo, fieldNumber: 6)
    }
    if self.destination != .nop {
      try visitor.visitSingularEnumField(value: self.destination, fieldNumber: 7)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Tensorflow_GraphTransferInfo, rhs: Tensorflow_GraphTransferInfo) -> Bool {
    if lhs.nodeInfo != rhs.nodeInfo {return false}
    if lhs.constNodeInfo != rhs.constNodeInfo {return false}
    if lhs.nodeInputInfo != rhs.nodeInputInfo {return false}
    if lhs.nodeOutputInfo != rhs.nodeOutputInfo {return false}
    if lhs.graphInputNodeInfo != rhs.graphInputNodeInfo {return false}
    if lhs.graphOutputNodeInfo != rhs.graphOutputNodeInfo {return false}
    if lhs.destination != rhs.destination {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Tensorflow_GraphTransferInfo.Destination: SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    0: .same(proto: "NOP"),
    1: .same(proto: "HEXAGON"),
  ]
}
