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

// Copyright 2016 The TensorFlow Authors. All Rights Reserved.
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//==============================================================================

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_CreateSessionRequest: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".CreateSessionRequest"

  /// The initial graph definition.
  public var graphDef: Tensorflow_GraphDef {
    get {return _storage._graphDef ?? Tensorflow_GraphDef()}
    set {_uniqueStorage()._graphDef = newValue}
  }
  /// Returns true if `graphDef` has been explicitly set.
  public var hasGraphDef: Bool {return _storage._graphDef != nil}
  /// Clears the value of `graphDef`. Subsequent reads from it will return its default value.
  public mutating func clearGraphDef() {_storage._graphDef = nil}

  /// Configuration options.
  public var config: Tensorflow_ConfigProto {
    get {return _storage._config ?? Tensorflow_ConfigProto()}
    set {_uniqueStorage()._config = newValue}
  }
  /// Returns true if `config` has been explicitly set.
  public var hasConfig: Bool {return _storage._config != nil}
  /// Clears the value of `config`. Subsequent reads from it will return its default value.
  public mutating func clearConfig() {_storage._config = nil}

  /// The target string used from the client's perspective.
  public var target: String {
    get {return _storage._target}
    set {_uniqueStorage()._target = newValue}
  }

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        switch fieldNumber {
        case 1: try decoder.decodeSingularMessageField(value: &_storage._graphDef)
        case 2: try decoder.decodeSingularMessageField(value: &_storage._config)
        case 3: try decoder.decodeSingularStringField(value: &_storage._target)
        default: break
        }
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if let v = _storage._graphDef {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
      }
      if let v = _storage._config {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
      }
      if !_storage._target.isEmpty {
        try visitor.visitSingularStringField(value: _storage._target, fieldNumber: 3)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  fileprivate var _storage = _StorageClass.defaultInstance
}

public struct Tensorflow_CreateSessionResponse: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".CreateSessionResponse"

  /// The session handle to be used in subsequent calls for the created session.
  ///
  /// The client must arrange to call CloseSession with this returned
  /// session handle to close the session.
  public var sessionHandle: String = String()

  /// The initial version number for the graph, to be used in the next call
  /// to ExtendSession.
  public var graphVersion: Int64 = 0

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  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.sessionHandle)
      case 2: try decoder.decodeSingularInt64Field(value: &self.graphVersion)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.sessionHandle.isEmpty {
      try visitor.visitSingularStringField(value: self.sessionHandle, fieldNumber: 1)
    }
    if self.graphVersion != 0 {
      try visitor.visitSingularInt64Field(value: self.graphVersion, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Tensorflow_ExtendSessionRequest: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".ExtendSessionRequest"

  /// REQUIRED: session_handle must be returned by a CreateSession call
  /// to the same master service.
  public var sessionHandle: String {
    get {return _storage._sessionHandle}
    set {_uniqueStorage()._sessionHandle = newValue}
  }

  /// REQUIRED: The nodes to be added to the session's graph. If any node has
  /// the same name as an existing node, the operation will fail with
  /// ILLEGAL_ARGUMENT.
  public var graphDef: Tensorflow_GraphDef {
    get {return _storage._graphDef ?? Tensorflow_GraphDef()}
    set {_uniqueStorage()._graphDef = newValue}
  }
  /// Returns true if `graphDef` has been explicitly set.
  public var hasGraphDef: Bool {return _storage._graphDef != nil}
  /// Clears the value of `graphDef`. Subsequent reads from it will return its default value.
  public mutating func clearGraphDef() {_storage._graphDef = nil}

  /// REQUIRED: The version number of the graph to be extended. This will be
  /// tested against the current server-side version number, and the operation
  /// will fail with FAILED_PRECONDITION if they do not match.
  public var currentGraphVersion: Int64 {
    get {return _storage._currentGraphVersion}
    set {_uniqueStorage()._currentGraphVersion = newValue}
  }

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        switch fieldNumber {
        case 1: try decoder.decodeSingularStringField(value: &_storage._sessionHandle)
        case 2: try decoder.decodeSingularMessageField(value: &_storage._graphDef)
        case 3: try decoder.decodeSingularInt64Field(value: &_storage._currentGraphVersion)
        default: break
        }
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if !_storage._sessionHandle.isEmpty {
        try visitor.visitSingularStringField(value: _storage._sessionHandle, fieldNumber: 1)
      }
      if let v = _storage._graphDef {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
      }
      if _storage._currentGraphVersion != 0 {
        try visitor.visitSingularInt64Field(value: _storage._currentGraphVersion, fieldNumber: 3)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  fileprivate var _storage = _StorageClass.defaultInstance
}

/// TODO(mrry): Return something about the operation?
public struct Tensorflow_ExtendSessionResponse: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".ExtendSessionResponse"

  /// The new version number for the extended graph, to be used in the next call
  /// to ExtendSession.
  public var newGraphVersion: Int64 = 0

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 4: try decoder.decodeSingularInt64Field(value: &self.newGraphVersion)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.newGraphVersion != 0 {
      try visitor.visitSingularInt64Field(value: self.newGraphVersion, fieldNumber: 4)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Tensorflow_RunStepRequest: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".RunStepRequest"

  /// REQUIRED: session_handle must be returned by a CreateSession call
  /// to the same master service.
  public var sessionHandle: String {
    get {return _storage._sessionHandle}
    set {_uniqueStorage()._sessionHandle = newValue}
  }

  /// Tensors to be fed in the step. Each feed is a named tensor.
  public var feed: [Tensorflow_NamedTensorProto] {
    get {return _storage._feed}
    set {_uniqueStorage()._feed = newValue}
  }

  /// Fetches. A list of tensor names. The caller expects a tensor to
  /// be returned for each fetch[i] (see RunStepResponse.tensor). The
  /// order of specified fetches does not change the execution order.
  public var fetch: [String] {
    get {return _storage._fetch}
    set {_uniqueStorage()._fetch = newValue}
  }

  /// Target Nodes. A list of node names. The named nodes will be run
  /// to but their outputs will not be fetched.
  public var target: [String] {
    get {return _storage._target}
    set {_uniqueStorage()._target = newValue}
  }

  /// Options for the run call.
  public var options: Tensorflow_RunOptions {
    get {return _storage._options ?? Tensorflow_RunOptions()}
    set {_uniqueStorage()._options = newValue}
  }
  /// Returns true if `options` has been explicitly set.
  public var hasOptions: Bool {return _storage._options != nil}
  /// Clears the value of `options`. Subsequent reads from it will return its default value.
  public mutating func clearOptions() {_storage._options = nil}

  /// Partial run handle (optional). If specified, this will be a partial run
  /// execution, run up to the specified fetches.
  public var partialRunHandle: String {
    get {return _storage._partialRunHandle}
    set {_uniqueStorage()._partialRunHandle = newValue}
  }

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        switch fieldNumber {
        case 1: try decoder.decodeSingularStringField(value: &_storage._sessionHandle)
        case 2: try decoder.decodeRepeatedMessageField(value: &_storage._feed)
        case 3: try decoder.decodeRepeatedStringField(value: &_storage._fetch)
        case 4: try decoder.decodeRepeatedStringField(value: &_storage._target)
        case 5: try decoder.decodeSingularMessageField(value: &_storage._options)
        case 6: try decoder.decodeSingularStringField(value: &_storage._partialRunHandle)
        default: break
        }
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if !_storage._sessionHandle.isEmpty {
        try visitor.visitSingularStringField(value: _storage._sessionHandle, fieldNumber: 1)
      }
      if !_storage._feed.isEmpty {
        try visitor.visitRepeatedMessageField(value: _storage._feed, fieldNumber: 2)
      }
      if !_storage._fetch.isEmpty {
        try visitor.visitRepeatedStringField(value: _storage._fetch, fieldNumber: 3)
      }
      if !_storage._target.isEmpty {
        try visitor.visitRepeatedStringField(value: _storage._target, fieldNumber: 4)
      }
      if let v = _storage._options {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
      }
      if !_storage._partialRunHandle.isEmpty {
        try visitor.visitSingularStringField(value: _storage._partialRunHandle, fieldNumber: 6)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  fileprivate var _storage = _StorageClass.defaultInstance
}

public struct Tensorflow_RunStepResponse: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".RunStepResponse"

  /// NOTE: The order of the returned tensors may or may not match
  /// the fetch order specified in RunStepRequest.
  public var tensor: [Tensorflow_NamedTensorProto] {
    get {return _storage._tensor}
    set {_uniqueStorage()._tensor = newValue}
  }

  /// Returned metadata if requested in the options.
  public var metadata: Tensorflow_RunMetadata {
    get {return _storage._metadata ?? Tensorflow_RunMetadata()}
    set {_uniqueStorage()._metadata = newValue}
  }
  /// Returns true if `metadata` has been explicitly set.
  public var hasMetadata: Bool {return _storage._metadata != nil}
  /// Clears the value of `metadata`. Subsequent reads from it will return its default value.
  public mutating func clearMetadata() {_storage._metadata = nil}

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        switch fieldNumber {
        case 1: try decoder.decodeRepeatedMessageField(value: &_storage._tensor)
        case 2: try decoder.decodeSingularMessageField(value: &_storage._metadata)
        default: break
        }
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if !_storage._tensor.isEmpty {
        try visitor.visitRepeatedMessageField(value: _storage._tensor, fieldNumber: 1)
      }
      if let v = _storage._metadata {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  fileprivate var _storage = _StorageClass.defaultInstance
}

public struct Tensorflow_PartialRunSetupRequest: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".PartialRunSetupRequest"

  /// REQUIRED: session_handle must be returned by a CreateSession call
  /// to the same master service.
  public var sessionHandle: String = String()

  /// Tensors to be fed in future steps.
  public var feed: [String] = []

  /// Fetches. A list of tensor names. The caller expects a tensor to be returned
  /// for each fetch[i] (see RunStepResponse.tensor), for corresponding partial
  /// RunStepRequests. The order of specified fetches does not change the
  /// execution order.
  public var fetch: [String] = []

  /// Target Nodes. A list of node names. The named nodes will be run in future
  /// steps, but their outputs will not be fetched.
  public var target: [String] = []

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  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.sessionHandle)
      case 2: try decoder.decodeRepeatedStringField(value: &self.feed)
      case 3: try decoder.decodeRepeatedStringField(value: &self.fetch)
      case 4: try decoder.decodeRepeatedStringField(value: &self.target)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.sessionHandle.isEmpty {
      try visitor.visitSingularStringField(value: self.sessionHandle, fieldNumber: 1)
    }
    if !self.feed.isEmpty {
      try visitor.visitRepeatedStringField(value: self.feed, fieldNumber: 2)
    }
    if !self.fetch.isEmpty {
      try visitor.visitRepeatedStringField(value: self.fetch, fieldNumber: 3)
    }
    if !self.target.isEmpty {
      try visitor.visitRepeatedStringField(value: self.target, fieldNumber: 4)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Tensorflow_PartialRunSetupResponse: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".PartialRunSetupResponse"

  /// The unique handle corresponding to the ongoing partial run call setup by
  /// the invocation to PartialRunSetup. This handle may be passed to
  /// RunStepRequest to send and receive tensors for this partial run.
  public var partialRunHandle: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  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.partialRunHandle)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.partialRunHandle.isEmpty {
      try visitor.visitSingularStringField(value: self.partialRunHandle, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Tensorflow_CloseSessionRequest: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".CloseSessionRequest"

  /// REQUIRED: session_handle must be returned by a CreateSession call
  /// to the same master service.
  public var sessionHandle: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  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.sessionHandle)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.sessionHandle.isEmpty {
      try visitor.visitSingularStringField(value: self.sessionHandle, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Tensorflow_CloseSessionResponse: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".CloseSessionResponse"

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let _ = try decoder.nextFieldNumber() {
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try unknownFields.traverse(visitor: &visitor)
  }
}

/// Reset() allows misbehaving or slow sessions to be aborted and closed, and
/// causes their resources eventually to be released.  Reset() does not wait
/// for the computations in old sessions to cease; it merely starts the
/// process of tearing them down.  However, if a new session is started after
/// a Reset(), the new session is isolated from changes that old sessions
/// (started prior to the Reset()) may continue to make to resources, provided
/// all those resources are in containers listed in "containers".
///
/// Old sessions may continue to have side-effects on resources not in
/// containers listed in "containers", and thus may affect future
/// sessions' results in ways that are hard to predict.  Thus, if well-defined
/// behavior is desired, is it recommended that all containers be listed in
/// "containers".  Similarly, if a device_filter is specified, results may be
/// hard to predict.
public struct Tensorflow_ResetRequest: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".ResetRequest"

  /// A list of container names, which may be empty.
  ///
  /// If 'container' is not empty, releases resoures in the given
  /// containers in all devices.
  ///
  /// If 'container' is empty, releases resources in the default
  /// container in all devices.
  public var container: [String] = []

  /// When any filters are present, only devices that match the filters
  /// will be reset. Each filter can be partially specified,
  /// e.g. "/job:ps" "/job:worker/replica:3", etc.
  public var deviceFilters: [String] = []

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeRepeatedStringField(value: &self.container)
      case 2: try decoder.decodeRepeatedStringField(value: &self.deviceFilters)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.container.isEmpty {
      try visitor.visitRepeatedStringField(value: self.container, fieldNumber: 1)
    }
    if !self.deviceFilters.isEmpty {
      try visitor.visitRepeatedStringField(value: self.deviceFilters, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Tensorflow_ResetResponse: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".ResetResponse"

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let _ = try decoder.nextFieldNumber() {
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Tensorflow_ListDevicesRequest: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".ListDevicesRequest"

  /// Optional: session_handle must be returned by a CreateSession call to the
  /// same master service.
  ///
  /// When session_handle is empty, the ClusterSpec provided when the master was
  /// started is used to compute the available devices. If the session_handle is
  /// provided but not recognized, an error is returned. Finally, if a valid
  /// session_handle is provided, the cluster configuration for that session is
  /// used when computing the response.
  public var sessionHandle: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  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.sessionHandle)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.sessionHandle.isEmpty {
      try visitor.visitSingularStringField(value: self.sessionHandle, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Tensorflow_ListDevicesResponse: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".ListDevicesResponse"

  public var localDevice: [Tensorflow_DeviceAttributes] = []

  public var remoteDevice: [Tensorflow_DeviceAttributes] = []

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  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.localDevice)
      case 2: try decoder.decodeRepeatedMessageField(value: &self.remoteDevice)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.localDevice.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.localDevice, fieldNumber: 1)
    }
    if !self.remoteDevice.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.remoteDevice, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

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

fileprivate let _protobuf_package = "tensorflow"

extension Tensorflow_CreateSessionRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "graph_def"),
    2: .same(proto: "config"),
    3: .same(proto: "target"),
  ]

  fileprivate class _StorageClass {
    var _graphDef: Tensorflow_GraphDef? = nil
    var _config: Tensorflow_ConfigProto? = nil
    var _target: String = String()

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _graphDef = source._graphDef
      _config = source._config
      _target = source._target
    }
  }

  fileprivate mutating func _uniqueStorage() -> _StorageClass {
    if !isKnownUniquelyReferenced(&_storage) {
      _storage = _StorageClass(copying: _storage)
    }
    return _storage
  }

  public func _protobuf_generated_isEqualTo(other: Tensorflow_CreateSessionRequest) -> Bool {
    if _storage !== other._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let other_storage = _args.1
        if _storage._graphDef != other_storage._graphDef {return false}
        if _storage._config != other_storage._config {return false}
        if _storage._target != other_storage._target {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_CreateSessionResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "session_handle"),
    2: .standard(proto: "graph_version"),
  ]

  public func _protobuf_generated_isEqualTo(other: Tensorflow_CreateSessionResponse) -> Bool {
    if self.sessionHandle != other.sessionHandle {return false}
    if self.graphVersion != other.graphVersion {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_ExtendSessionRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "session_handle"),
    2: .standard(proto: "graph_def"),
    3: .standard(proto: "current_graph_version"),
  ]

  fileprivate class _StorageClass {
    var _sessionHandle: String = String()
    var _graphDef: Tensorflow_GraphDef? = nil
    var _currentGraphVersion: Int64 = 0

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _sessionHandle = source._sessionHandle
      _graphDef = source._graphDef
      _currentGraphVersion = source._currentGraphVersion
    }
  }

  fileprivate mutating func _uniqueStorage() -> _StorageClass {
    if !isKnownUniquelyReferenced(&_storage) {
      _storage = _StorageClass(copying: _storage)
    }
    return _storage
  }

  public func _protobuf_generated_isEqualTo(other: Tensorflow_ExtendSessionRequest) -> Bool {
    if _storage !== other._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let other_storage = _args.1
        if _storage._sessionHandle != other_storage._sessionHandle {return false}
        if _storage._graphDef != other_storage._graphDef {return false}
        if _storage._currentGraphVersion != other_storage._currentGraphVersion {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_ExtendSessionResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    4: .standard(proto: "new_graph_version"),
  ]

  public func _protobuf_generated_isEqualTo(other: Tensorflow_ExtendSessionResponse) -> Bool {
    if self.newGraphVersion != other.newGraphVersion {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_RunStepRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "session_handle"),
    2: .same(proto: "feed"),
    3: .same(proto: "fetch"),
    4: .same(proto: "target"),
    5: .same(proto: "options"),
    6: .standard(proto: "partial_run_handle"),
  ]

  fileprivate class _StorageClass {
    var _sessionHandle: String = String()
    var _feed: [Tensorflow_NamedTensorProto] = []
    var _fetch: [String] = []
    var _target: [String] = []
    var _options: Tensorflow_RunOptions? = nil
    var _partialRunHandle: String = String()

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _sessionHandle = source._sessionHandle
      _feed = source._feed
      _fetch = source._fetch
      _target = source._target
      _options = source._options
      _partialRunHandle = source._partialRunHandle
    }
  }

  fileprivate mutating func _uniqueStorage() -> _StorageClass {
    if !isKnownUniquelyReferenced(&_storage) {
      _storage = _StorageClass(copying: _storage)
    }
    return _storage
  }

  public func _protobuf_generated_isEqualTo(other: Tensorflow_RunStepRequest) -> Bool {
    if _storage !== other._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let other_storage = _args.1
        if _storage._sessionHandle != other_storage._sessionHandle {return false}
        if _storage._feed != other_storage._feed {return false}
        if _storage._fetch != other_storage._fetch {return false}
        if _storage._target != other_storage._target {return false}
        if _storage._options != other_storage._options {return false}
        if _storage._partialRunHandle != other_storage._partialRunHandle {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_RunStepResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "tensor"),
    2: .same(proto: "metadata"),
  ]

  fileprivate class _StorageClass {
    var _tensor: [Tensorflow_NamedTensorProto] = []
    var _metadata: Tensorflow_RunMetadata? = nil

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _tensor = source._tensor
      _metadata = source._metadata
    }
  }

  fileprivate mutating func _uniqueStorage() -> _StorageClass {
    if !isKnownUniquelyReferenced(&_storage) {
      _storage = _StorageClass(copying: _storage)
    }
    return _storage
  }

  public func _protobuf_generated_isEqualTo(other: Tensorflow_RunStepResponse) -> Bool {
    if _storage !== other._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let other_storage = _args.1
        if _storage._tensor != other_storage._tensor {return false}
        if _storage._metadata != other_storage._metadata {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_PartialRunSetupRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "session_handle"),
    2: .same(proto: "feed"),
    3: .same(proto: "fetch"),
    4: .same(proto: "target"),
  ]

  public func _protobuf_generated_isEqualTo(other: Tensorflow_PartialRunSetupRequest) -> Bool {
    if self.sessionHandle != other.sessionHandle {return false}
    if self.feed != other.feed {return false}
    if self.fetch != other.fetch {return false}
    if self.target != other.target {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_PartialRunSetupResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "partial_run_handle"),
  ]

  public func _protobuf_generated_isEqualTo(other: Tensorflow_PartialRunSetupResponse) -> Bool {
    if self.partialRunHandle != other.partialRunHandle {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_CloseSessionRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "session_handle"),
  ]

  public func _protobuf_generated_isEqualTo(other: Tensorflow_CloseSessionRequest) -> Bool {
    if self.sessionHandle != other.sessionHandle {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_CloseSessionResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap = SwiftProtobuf._NameMap()

  public func _protobuf_generated_isEqualTo(other: Tensorflow_CloseSessionResponse) -> Bool {
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_ResetRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "container"),
    2: .standard(proto: "device_filters"),
  ]

  public func _protobuf_generated_isEqualTo(other: Tensorflow_ResetRequest) -> Bool {
    if self.container != other.container {return false}
    if self.deviceFilters != other.deviceFilters {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_ResetResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap = SwiftProtobuf._NameMap()

  public func _protobuf_generated_isEqualTo(other: Tensorflow_ResetResponse) -> Bool {
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_ListDevicesRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "session_handle"),
  ]

  public func _protobuf_generated_isEqualTo(other: Tensorflow_ListDevicesRequest) -> Bool {
    if self.sessionHandle != other.sessionHandle {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Tensorflow_ListDevicesResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "local_device"),
    2: .standard(proto: "remote_device"),
  ]

  public func _protobuf_generated_isEqualTo(other: Tensorflow_ListDevicesResponse) -> Bool {
    if self.localDevice != other.localDevice {return false}
    if self.remoteDevice != other.remoteDevice {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}
