Tablica

extension Array: MutableCollectionAlgorithms
extension Array: KeyPathIterable
extension Array: Differentiable where Element: Differentiable
extension Array: EuclideanDifferentiable
where Element: EuclideanDifferentiable
extension Array where Element: Differentiable
extension Array : ConvertibleFromNumpyArray
where Element : NumpyScalarCompatible
public extension Array where Element : NumpyScalarCompatible
extension Array : PythonConvertible where Element : PythonConvertible
extension Array : ConvertibleFromPython where Element : ConvertibleFromPython
extension Array: ElementaryFunctions where Element: ElementaryFunctions
extension Array: TensorArrayProtocol where Element: TensorGroup
extension Array where Element == Bool
extension Array where Element == UInt8
extension Array where Element == Int64
extension Array where Element == XLATensor
extension Array where Element: AnyTensor
extension Array where Element == PaddingConfigDimension
Dostępne, gdy `Element`: `Różniczalny`
Dostępne, gdy `Element`: `EuclideanDifferentiable`
Dostępne, gdy `Element`: `Różniczalny`
Dostępne, gdy `Element` : `NumpyScalarCompatible`
  • Tworzy Array o tym samym kształcie i skalarach co określone wystąpienie numpy.ndarray .

    Warunek wstępny

    Należy zainstalować pakiet numpy Python.

    Deklaracja

    public init?(numpy numpyArray: PythonObject)

    Parametry

    numpyArray

    Instancja numpy.ndarray do przekonwertowania.

    Wartość zwracana

    numpyArray przekonwertowany na Array . Zwraca nil , jeśli numpyArray nie jest 1-D lub nie ma kompatybilnego dtype skalarnego.

  • Tworzy instancję 1-D numpy.ndarray z tymi samymi skalarami co ta Array .

    Warunek wstępny

    Należy zainstalować pakiet numpy Python.

    Deklaracja

    func makeNumpyArray() -> PythonObject
Dostępne, gdy `Element` : `PythonConvertible`
Dostępne, gdy `Element` : `ConvertibleFromPython`
Dostępne, gdy `Element`: `ElementaryFunctions`
  • Pierwiastek kwadratowy z x .

    W przypadku typów rzeczywistych, jeśli x jest ujemne, wynikiem jest .nan . W przypadku typów złożonych następuje odcięcie gałęzi na ujemnej osi rzeczywistej.

    Deklaracja

    public static func sqrt(_ x: `Self`) -> Array<Element>
  • Cosinus x , interpretowany jako kąt w radianach.

    Deklaracja

    public static func cos(_ x: `Self`) -> Array<Element>
  • Sinus x , interpretowany jako kąt w radianach.

    Deklaracja

    public static func sin(_ x: `Self`) -> Array<Element>
  • Tangens x , interpretowany jako kąt w radianach.

    Deklaracja

    public static func tan(_ x: `Self`) -> Array<Element>
  • Odwrotny cosinus x w radianach.

    Deklaracja

    public static func acos(_ x: `Self`) -> Array<Element>
  • Odwrotny sinus x w radianach.

    Deklaracja

    public static func asin(_ x: `Self`) -> Array<Element>
  • Odwrotny tangens x w radianach.

    Deklaracja

    public static func atan(_ x: `Self`) -> Array<Element>
  • Cosinus hiperboliczny x .

    Deklaracja

    public static func cosh(_ x: `Self`) -> Array<Element>
  • Sinus hiperboliczny x .

    Deklaracja

    public static func sinh(_ x: `Self`) -> Array<Element>
  • Tangens hiperboliczny x .

    Deklaracja

    public static func tanh(_ x: `Self`) -> Array<Element>
  • Odwrotny cosinus hiperboliczny x .

    Deklaracja

    public static func acosh(_ x: `Self`) -> Array<Element>
  • Odwrotny sinus hiperboliczny x .

    Deklaracja

    public static func asinh(_ x: `Self`) -> Array<Element>
  • Odwrotny tangens hiperboliczny x .

    Deklaracja

    public static func atanh(_ x: `Self`) -> Array<Element>
  • Funkcja wykładnicza zastosowana do x lub e**x .

    Deklaracja

    public static func exp(_ x: `Self`) -> Array<Element>
  • Dwa podniesione do potęgi x .

    Deklaracja

    public static func exp2(_ x: `Self`) -> Array<Element>
  • Dziesięć podniesione do potęgi x .

    Deklaracja

    public static func exp10(_ x: `Self`) -> Array<Element>
  • exp(x) - 1 oceniane tak, aby zachować dokładność bliską zeru.

    Deklaracja

    public static func expm1(_ x: `Self`) -> Array<Element>
  • Logarytm naturalny x .

    Deklaracja

    public static func log(_ x: `Self`) -> Array<Element>
  • Logarytm o podstawie dwóch z x .

    Deklaracja

    public static func log2(_ x: `Self`) -> Array<Element>
  • Logarytm dziesiętny z x .

    Deklaracja

    public static func log10(_ x: `Self`) -> Array<Element>
  • log(1 + x) oceniany tak, aby zachować dokładność bliską zeru.

    Deklaracja

    public static func log1p(_ x: `Self`) -> Array<Element>
  • exp(y log(x)) obliczone bez utraty precyzji pośredniej.

    W przypadku typów rzeczywistych, jeśli x jest ujemne, wynikiem jest NaN, nawet jeśli y ma wartość całkowitą. W przypadku typów złożonych następuje odcięcie gałęzi na ujemnej osi rzeczywistej.

    Deklaracja

    public static func pow(_ x: `Self`, _ y: `Self`) -> Array<Element>
  • x podniesione do n tej potęgi.

    Iloczyn n kopii x .

    Deklaracja

    public static func pow(_ x: `Self`, _ n: Int) -> Array<Element>
  • n ty pierwiastek z x .

    W przypadku typów rzeczywistych, jeśli x jest ujemne, a n parzyste, wynikiem jest NaN. W przypadku typów złożonych odgałęzienie jest wycinane wzdłuż ujemnej osi rzeczywistej.

    Deklaracja

    public static func root(_ x: `Self`, _ n: Int) -> Array<Element>
Dostępne, gdy `Element`: `TensorGroup`
  • Deklaracja

    public init(_owning tensorHandles: UnsafePointer<CTensorHandle>?, count: Int)
  • Deklaracja

    public init<C: RandomAccessCollection>(
      _handles: C
    ) where C.Element: _AnyTensorHandle
Dostępne gdzie `Element` == `UInt8`
  • Notatka

    Hash SHA1 ma tylko 20 bajtów, dlatego tylko pierwsze 20 bajtów zwróconego SIMD32<UInt8> jest niezerowych.

    Deklaracja

    func sha1() -> SIMD32<UInt8>
  • Deklaracja

    func sha512() -> SIMD64<UInt8>
Dostępne, gdzie `Element` == `Bool`
  • Oblicza a || b elementarnie, jakbyśmy łączyli ze sobą dwie maski.

    Deklaracja

    public func mergingMask(with other: [Bool]) -> [Bool]
Dostępne gdzie `Element` == `Int64`
  • Deklaracja

    func withArrayRef<Result>(_ body: (Int64ArrayRef) throws -> Result) rethrows -> Result
Dostępne, gdy `Element` == `XLATensor`
  • Deklaracja

    func withArrayRef<Result>(_ body: (OpaqueXLATensorArrayRef) throws -> Result) rethrows -> Result
Dostępne, gdy `Element`: `AnyTensor`
  • Deklaracja

    func withArrayRef<T, Result>(_ body: (OpaqueXLATensorArrayRef) throws -> Result) rethrows
      -> Result
    where Element == Tensor<T>
Dostępne, gdy `Element` == `PaddingConfigDimension`
  • Deklaracja

    func withArrayRef<Result>(_ body: (inout PaddingConfig) -> Result) -> Result
,
extension Array: MutableCollectionAlgorithms
extension Array: KeyPathIterable
extension Array: Differentiable where Element: Differentiable
extension Array: EuclideanDifferentiable
where Element: EuclideanDifferentiable
extension Array where Element: Differentiable
extension Array : ConvertibleFromNumpyArray
where Element : NumpyScalarCompatible
public extension Array where Element : NumpyScalarCompatible
extension Array : PythonConvertible where Element : PythonConvertible
extension Array : ConvertibleFromPython where Element : ConvertibleFromPython
extension Array: ElementaryFunctions where Element: ElementaryFunctions
extension Array: TensorArrayProtocol where Element: TensorGroup
extension Array where Element == Bool
extension Array where Element == UInt8
extension Array where Element == Int64
extension Array where Element == XLATensor
extension Array where Element: AnyTensor
extension Array where Element == PaddingConfigDimension
Dostępne, gdy `Element`: `Różniczalny`
Dostępne, gdy `Element`: `EuclideanDifferentiable`
Dostępne, gdy `Element`: `Różniczalny`
Dostępne, gdy `Element` : `NumpyScalarCompatible`
  • Tworzy Array o tym samym kształcie i skalarach co określone wystąpienie numpy.ndarray .

    Warunek wstępny

    Należy zainstalować pakiet numpy Python.

    Deklaracja

    public init?(numpy numpyArray: PythonObject)

    Parametry

    numpyArray

    Instancja numpy.ndarray do przekonwertowania.

    Wartość zwracana

    numpyArray przekonwertowany na Array . Zwraca nil , jeśli numpyArray nie jest 1-D lub nie ma kompatybilnego dtype skalarnego.

  • Tworzy instancję 1-D numpy.ndarray z tymi samymi skalarami co ta Array .

    Warunek wstępny

    Należy zainstalować pakiet numpy Python.

    Deklaracja

    func makeNumpyArray() -> PythonObject
Dostępne, gdy `Element` : `PythonConvertible`
Dostępne, gdy `Element` : `ConvertibleFromPython`
Dostępne, gdy `Element`: `ElementaryFunctions`
  • Pierwiastek kwadratowy z x .

    W przypadku typów rzeczywistych, jeśli x jest ujemne, wynikiem jest .nan . W przypadku typów złożonych następuje odcięcie gałęzi na ujemnej osi rzeczywistej.

    Deklaracja

    public static func sqrt(_ x: `Self`) -> Array<Element>
  • Cosinus x , interpretowany jako kąt w radianach.

    Deklaracja

    public static func cos(_ x: `Self`) -> Array<Element>
  • Sinus x , interpretowany jako kąt w radianach.

    Deklaracja

    public static func sin(_ x: `Self`) -> Array<Element>
  • Tangens x , interpretowany jako kąt w radianach.

    Deklaracja

    public static func tan(_ x: `Self`) -> Array<Element>
  • Odwrotny cosinus x w radianach.

    Deklaracja

    public static func acos(_ x: `Self`) -> Array<Element>
  • Odwrotny sinus x w radianach.

    Deklaracja

    public static func asin(_ x: `Self`) -> Array<Element>
  • Odwrotny tangens x w radianach.

    Deklaracja

    public static func atan(_ x: `Self`) -> Array<Element>
  • Cosinus hiperboliczny x .

    Deklaracja

    public static func cosh(_ x: `Self`) -> Array<Element>
  • Sinus hiperboliczny x .

    Deklaracja

    public static func sinh(_ x: `Self`) -> Array<Element>
  • Tangens hiperboliczny x .

    Deklaracja

    public static func tanh(_ x: `Self`) -> Array<Element>
  • Odwrotny cosinus hiperboliczny x .

    Deklaracja

    public static func acosh(_ x: `Self`) -> Array<Element>
  • Odwrotny sinus hiperboliczny x .

    Deklaracja

    public static func asinh(_ x: `Self`) -> Array<Element>
  • Odwrotny tangens hiperboliczny x .

    Deklaracja

    public static func atanh(_ x: `Self`) -> Array<Element>
  • Funkcja wykładnicza zastosowana do x lub e**x .

    Deklaracja

    public static func exp(_ x: `Self`) -> Array<Element>
  • Dwa podniesione do potęgi x .

    Deklaracja

    public static func exp2(_ x: `Self`) -> Array<Element>
  • Dziesięć podniesione do potęgi x .

    Deklaracja

    public static func exp10(_ x: `Self`) -> Array<Element>
  • exp(x) - 1 oceniane tak, aby zachować dokładność bliską zeru.

    Deklaracja

    public static func expm1(_ x: `Self`) -> Array<Element>
  • Logarytm naturalny x .

    Deklaracja

    public static func log(_ x: `Self`) -> Array<Element>
  • Logarytm o podstawie dwóch z x .

    Deklaracja

    public static func log2(_ x: `Self`) -> Array<Element>
  • Logarytm dziesiętny z x .

    Deklaracja

    public static func log10(_ x: `Self`) -> Array<Element>
  • log(1 + x) oceniany tak, aby zachować dokładność bliską zeru.

    Deklaracja

    public static func log1p(_ x: `Self`) -> Array<Element>
  • exp(y log(x)) obliczone bez utraty precyzji pośredniej.

    W przypadku typów rzeczywistych, jeśli x jest ujemne, wynikiem jest NaN, nawet jeśli y ma wartość całkowitą. W przypadku typów złożonych następuje odcięcie gałęzi na ujemnej osi rzeczywistej.

    Deklaracja

    public static func pow(_ x: `Self`, _ y: `Self`) -> Array<Element>
  • x podniesione do n tej potęgi.

    Iloczyn n kopii x .

    Deklaracja

    public static func pow(_ x: `Self`, _ n: Int) -> Array<Element>
  • n ty pierwiastek z x .

    W przypadku typów rzeczywistych, jeśli x jest ujemne, a n parzyste, wynikiem jest NaN. W przypadku typów złożonych odgałęzienie jest wycinane wzdłuż ujemnej osi rzeczywistej.

    Deklaracja

    public static func root(_ x: `Self`, _ n: Int) -> Array<Element>
Dostępne, gdy `Element`: `TensorGroup`
  • Deklaracja

    public init(_owning tensorHandles: UnsafePointer<CTensorHandle>?, count: Int)
  • Deklaracja

    public init<C: RandomAccessCollection>(
      _handles: C
    ) where C.Element: _AnyTensorHandle
Dostępne gdzie `Element` == `UInt8`
  • Notatka

    Hash SHA1 ma tylko 20 bajtów, dlatego tylko pierwsze 20 bajtów zwróconego SIMD32<UInt8> jest niezerowych.

    Deklaracja

    func sha1() -> SIMD32<UInt8>
  • Deklaracja

    func sha512() -> SIMD64<UInt8>
Dostępne, gdzie `Element` == `Bool`
  • Oblicza a || b elementarnie, jakbyśmy łączyli ze sobą dwie maski.

    Deklaracja

    public func mergingMask(with other: [Bool]) -> [Bool]
Dostępne gdzie `Element` == `Int64`
  • Deklaracja

    func withArrayRef<Result>(_ body: (Int64ArrayRef) throws -> Result) rethrows -> Result
Dostępne, gdy `Element` == `XLATensor`
  • Deklaracja

    func withArrayRef<Result>(_ body: (OpaqueXLATensorArrayRef) throws -> Result) rethrows -> Result
Dostępne, gdy `Element`: `AnyTensor`
  • Deklaracja

    func withArrayRef<T, Result>(_ body: (OpaqueXLATensorArrayRef) throws -> Result) rethrows
      -> Result
    where Element == Tensor<T>
Dostępne, gdy `Element` == `PaddingConfigDimension`
  • Deklaracja

    func withArrayRef<Result>(_ body: (inout PaddingConfig) -> Result) -> Result