배열

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
표시자5 l10n-
public extension Array where Element : NumpyScalarCompatible
extension Array : PythonConvertible where Element : PythonConvertible
자리 표시
extension Array: ElementaryFunctions where Element: ElementaryFunctions
표시
extension Array where Element == UInt8
extension Array: TensorArrayProtocol where Element: TensorGroup
extension Array where Element == Bool
extension Array where Element == Int64
extension Array : ConvertibleFromPython where Element : ConvertibleFromPython
extension Array where Element == XLATensor
extension Array where Element: AnyTensor
extension Array where Element == PaddingConfigDimension
'요소': '미분 가능'인 경우에 사용 가능
`요소`: `EuclideanDifferentiable`에서 사용 가능
'요소': '미분 가능'인 경우에 사용 가능
  • 선언

    @derivative
    init(repeating: count)
  • 선언

    @differentiable(wrt: self)
    public func differentiableMap<Result: Differentiable>(
      _ body: @differentiable (Element) -> Result
    ) -> [Result]
  • 선언

    @differentiable(wrt: (self, initialResult)
    public func differentiableReduce<Result: Differentiable>(
      _ initialResult: Result,
      _ nextPartialResult: @differentiable (Result, Element) -> Result
    ) -> Result
'요소': 'NumpyScalarCompatible'에서 사용 가능
  • 지정된 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`에서 사용 가능
`요소`: `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>
  • 두 개를 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) 0에 가까운 정확도를 유지하도록 계산되었습니다.

    선언

    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>
  • x n 승으로 올렸습니다.

    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>
`요소`: `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바이트만 0이 아닙니다.

    선언

    func sha1() -> SIMD32<UInt8>
  • 선언

    func sha512() -> SIMD64<UInt8>
`Element` == `Bool`에서 사용 가능
  • a || b 계산합니다. a || b 요소적으로는 마치 두 개의 마스크를 함께 사용하는 것처럼 보입니다.

    선언

    public func mergingMask(with other: [Bool]) -> [Bool]
`요소` == `Int64`에서 사용 가능
  • 선언

    func withArrayRef<Result>(_ body: (Int64ArrayRef) throws -> Result) rethrows -> Result
`요소` == `XLATensor`에서 사용 가능
  • 선언

    func withArrayRef<Result>(_ body: (OpaqueXLATensorArrayRef) throws -> Result) rethrows -> Result
'요소': '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