NumericType

public protocol NumericType : CPUNumeric, ZeroableType, ExpressibleByFloatLiteral

A type that can be used as a number in a Tensor.

  • Formats the number with the given amount of decimal places

    Declaration

    Swift

    func format(maxDecimals: Int) -> String

    Parameters

    maxDecimals

    Maximum amount of decimal places

  • Undocumented

    Declaration

    Swift

    init(_ floatValue: Double)
  • Undocumented

    Declaration

    Swift

    init(_ integerValue: Int32)
  • Undocumented

    Declaration

    Swift

    static var zero: Self { get }
  • one

    Undocumented

    Declaration

    Swift

    static var one: Self { get }
  • Undocumented

    Declaration

    Swift

    var floatValue: Float { get }
  • Undocumented

    Declaration

    Swift

    var doubleValue: Double { get }
  • Undocumented

    Declaration

    Swift

    var intValue: Int32 { get }
  • Undocumented

    Declaration

    Swift

    prefix static func - (value: Self) -> Self
  • Undocumented

    Declaration

    Swift

    static func + (lhs: Self, rhs: Self) -> Self
  • Undocumented

    Declaration

    Swift

    static func - (lhs: Self, rhs: Self) -> Self
  • Undocumented

    Declaration

    Swift

    static func / (lhs: Self, rhs: Self) -> Self
  • Undocumented

    Declaration

    Swift

    static func * (lhs: Self, rhs: Self) -> Self
  • Undocumented

    Declaration

    Swift

    func sqrt() -> Self
  • Undocumented

    Declaration

    Swift

    func log() -> Self
  • Undocumented

    Declaration

    Swift

    func exp() -> Self
  • Undocumented

    Declaration

    Swift

    func sin() -> Self
  • Undocumented

    Declaration

    Swift

    func cos() -> Self
  • Undocumented

    Declaration

    Swift

    func tan() -> Self
  • Undocumented

    Declaration

    Swift

    func sinh() -> Self
  • Undocumented

    Declaration

    Swift

    func cosh() -> Self
  • Undocumented

    Declaration

    Swift

    func tanh() -> Self
  • Undocumented

    Declaration

    Swift

    var isFinite: Bool { get }
  • Undocumented

    Declaration

    Swift

    var isNaN: Bool { get }
  • Undocumented

    Declaration

    Swift

    init(_ float: Float)
  • Undocumented

    Declaration

    Swift

    init(_ int: Int)
  • Undocumented

    Declaration

    Swift

    init(_ uint: UInt)
  • Undocumented

    Declaration

    Swift

    init(_ uint8: UInt8)
  • Undocumented

    Declaration

    Swift

    func toUInt8() -> UInt8
  • Undocumented

    Declaration

    Swift

    func toInt() -> Int
  • +=(_:_:) Extension method

    Declaration

    Swift

    @_specialize(exported: false, kind: full, where Self == Float)
    @_specialize(exported: false, kind: full, where Self == Double)
    @_specialize(exported: false, kind: full, where Self == Int32)
    @inline(__always)
    static func += (lhs: inout Self, rhs: Self)
  • -=(_:_:) Extension method

    Declaration

    Swift

    @_specialize(exported: false, kind: full, where Self == Float)
    @_specialize(exported: false, kind: full, where Self == Double)
    @_specialize(exported: false, kind: full, where Self == Int32)
    @inline(__always)
    static func -= (lhs: inout Self, rhs: Self)
  • *=(_:_:) Extension method

    Declaration

    Swift

    @_specialize(exported: false, kind: full, where Self == Float)
    @_specialize(exported: false, kind: full, where Self == Double)
    @_specialize(exported: false, kind: full, where Self == Int32)
    @inline(__always)
    static func *= (lhs: inout Self, rhs: Self)
  • /=(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    @_specialize(exported: false, kind: full, where Self == Float)
    @_specialize(exported: false, kind: full, where Self == Double)
    @_specialize(exported: false, kind: full, where Self == Int32)
    @inline(__always)
    static func /= (lhs: inout Self, rhs: Self)