配列

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 == UInt8
extension Array where Element == Bool
extension Array where Element == Int64
extension Array where Element == XLATensor
extension Array where Element: AnyTensor
extension Array where Element == PaddingConfigDimension
`Element`: `Differentiable` で利用可能
`Element`: `EuclideanDifferentiable` で利用可能
`Element`: `Differentiable` で利用可能
`Element` : `NumpyScalarSupport` で利用可能
  • 指定されたnumpy.ndarrayインスタンスと同じ形状とスカラーを持つArrayを作成します。

    前提条件

    numpy Python パッケージをインストールする必要があります。

    宣言

    public init?(numpy numpyArray: PythonObject)

    パラメーター

    numpyArray

    変換するnumpy.ndarrayインスタンス。

    戻り値

    numpyArray Arrayに変換しました。 numpyArray 1 次元でない場合、または互換性のあるスカラーdtypeがない場合はnilを返します。

  • このArrayと同じスカラーを持つ 1 次元のnumpy.ndarrayインスタンスを作成します。

    前提条件

    numpy Python パッケージをインストールする必要があります。

    宣言

    func makeNumpyArray() -> PythonObject
`Element` : `PythonConvertible` で利用可能
`Element` : `ConvertibleFromPython` で利用可能
`Element`: `ElementaryFunctions` で利用可能
  • xの平方根。

    実数型の場合、 xが負の場合、結果は.nanになります。複合型の場合、負の実軸に分岐カットがあります。

    宣言

    public static func sqrt(_ x: `Self`) -> Array<Element>
  • xの余弦。ラジアン単位の角度として解釈されます。

    宣言

    public static func cos(_ x: `Self`) -> Array<Element>
  • xのサイン。ラジアン単位の角度として解釈されます。

    宣言

    public static func sin(_ x: `Self`) -> Array<Element>
  • xのタンジェント。ラジアン単位の角度として解釈されます。

    宣言

    public static func tan(_ x: `Self`) -> Array<Element>
  • xの逆余弦 (ラジアン単位)。

    宣言

    public static func acos(_ x: `Self`) -> Array<Element>
  • xの逆サイン (ラジアン単位)。

    宣言

    public static func asin(_ x: `Self`) -> Array<Element>
  • xの逆タンジェント (ラジアン単位)。

    宣言

    public static func atan(_ x: `Self`) -> Array<Element>
  • xの双曲線余弦。

    宣言

    public static func cosh(_ x: `Self`) -> Array<Element>
  • xの双曲線正弦。

    宣言

    public static func sinh(_ x: `Self`) -> Array<Element>
  • xの双曲線正接。

    宣言

    public static func tanh(_ x: `Self`) -> Array<Element>
  • xの逆双曲線余弦。

    宣言

    public static func acosh(_ x: `Self`) -> Array<Element>
  • xの逆双曲線正弦。

    宣言

    public static func asinh(_ x: `Self`) -> Array<Element>
  • xの逆双曲線正接。

    宣言

    public static func atanh(_ x: `Self`) -> Array<Element>
  • xまたはe**xに適用される指数関数。

    宣言

    public static func exp(_ x: `Self`) -> Array<Element>
  • 2 のx乗。

    宣言

    public static func exp2(_ x: `Self`) -> Array<Element>
  • 10 のx乗です。

    宣言

    public static func exp10(_ x: `Self`) -> Array<Element>
  • exp(x) - 1ゼロに近い精度を維持するように評価されます。

    宣言

    public static func expm1(_ x: `Self`) -> Array<Element>
  • xの自然対数。

    宣言

    public static func log(_ x: `Self`) -> Array<Element>
  • xの底 2 の対数。

    宣言

    public static func log2(_ x: `Self`) -> Array<Element>
  • xの 10 を底とする対数。

    宣言

    public static func log10(_ x: `Self`) -> Array<Element>
  • log(1 + x)ゼロに近い精度を維持するように評価されます。

    宣言

    public static func log1p(_ x: `Self`) -> Array<Element>
  • exp(y log(x))中間精度を失うことなく計算されます。

    実数型の場合、 xが負の場合、 y整数値であっても結果は NaN になります。複合型の場合、負の実軸に分岐カットがあります。

    宣言

    public static func pow(_ x: `Self`, _ y: `Self`) -> Array<Element>
  • xn乗。

    xnコピーの積。

    宣言

    public static func pow(_ x: `Self`, _ n: Int) -> Array<Element>
  • xn乗根。

    実数型の場合、 xが負でnが偶数の場合、結果は NaN になります。複合型の場合、負の実軸に沿って分岐が存在します。

    宣言

    public static func root(_ x: `Self`, _ n: Int) -> Array<Element>
`Element`: `TensorGroup` で利用可能
  • 宣言

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

    public init<C: RandomAccessCollection>(
      _handles: C
    ) where C.Element: _AnyTensorHandle
`Element` == `UInt8` の場合に利用可能
  • 注記

    SHA1 ハッシュの長さはわずか 20 バイトであるため、返されるSIMD32<UInt8>の最初の 20 バイトのみがゼロ以外です。

    宣言

    func sha1() -> SIMD32<UInt8>
  • 宣言

    func sha512() -> SIMD64<UInt8>
`Element` == `Bool` の場合に利用可能
  • a || b計算します。 a || b要素ごとに、あたかも 2 つのマスクを論理和で結合しているかのように。

    宣言

    public func mergingMask(with other: [Bool]) -> [Bool]
`Element` == `Int64` の場合に利用可能
  • 宣言

    func withArrayRef<Result>(_ body: (Int64ArrayRef) throws -> Result) rethrows -> Result
`Element` == `XLATensor` の場合に利用可能
  • 宣言

    func withArrayRef<Result>(_ body: (OpaqueXLATensorArrayRef) throws -> Result) rethrows -> Result
`Element`: `AnyTensor` で利用可能
  • 宣言

    func withArrayRef<T, Result>(_ body: (OpaqueXLATensorArrayRef) throws -> Result) rethrows
      -> Result
    where Element == Tensor<T>
`Element` == `PaddingConfigDimension` の場合に利用可能
  • 宣言

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