Device

public struct Device
extension Device: Equatable
extension Device: CustomStringConvertible

A device on which Tensors can be allocated.

  • The device kind: GPU, GPU, TPU, or remote TPU.

    Declaration

    public let kind: Kind
  • The device ordinal value.

    Declaration

    public let ordinal: Int
  • The backend used to dispatch the tensor operations.

    Declaration

    public let backend: Backend
  • Declaration

    public init(kind: Kind, ordinal: Int, backend: Backend = defaultBackend)
  • Backend used to dispatch the tensor operations.

    Declaration

    public enum Backend
  • A device kind.

    Declaration

    public enum Kind
  • Declaration

    public var isRemote: Bool { get }
  • Declaration

    public static var defaultBackend: Backend { get }
  • The default Device.

    Declaration

    public static var `default`: Device { get }
  • The default XLA device.

    Declaration

    public static var defaultXLA: Device { get }
  • The current TF Eager device.

    Declaration

    public static var defaultTFEager: Device { get }
  • An array of all devices.

    Declaration

    public static var allDevices: [Device] { get }
  • Declaration

    public static func setReplicationDevices(_ devices: [Device])
  • Declaration

    public static func getReplicationDevices() -> [Device]
  • Declaration

    public static func syncLiveTensorsForDevices(_ devices: [Device])
  • Declaration

    public static func == (lhs: Device, rhs: Device) -> Bool
  • Declaration

    public var description: String { get }
  • A list of devices used for training.

    Declaration

    public static var trainingDevices: [Device] { get }
  • A list of devices used for cross replica sums when training on trainingDevices.

    Declaration

    public static var crossReplicaSumDevices: [Device] { get }