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
คูณด้วยcount
ครั้งของตัวมันเองคำประกาศ
@frozen
public struct DifferentiableViewextension Array.DifferentiableView: Differentiable
where Element: Differentiableextension Array.DifferentiableView: EuclideanDifferentiable
where Element: EuclideanDifferentiableextension Array.DifferentiableView: Equatable
where Element: Differentiable & Equatableextension Array.DifferentiableView: ExpressibleByArrayLiteral
where Element: Differentiableextension Array.DifferentiableView: CustomStringConvertible
where Element: Differentiableextension Array.DifferentiableView: AdditiveArithmetic
where Element: AdditiveArithmetic & Differentiableextension Array.DifferentiableView: _KeyPathIterableBase
where Element: Differentiableextension Array.DifferentiableView: KeyPathIterable
where Element: Differentiableextension Array.DifferentiableView: ElementaryFunctions
where Element: Differentiable & ElementaryFunctionsextension Array.DifferentiableView:
BidirectionalCollection,
Collection,
MutableCollection,
RandomAccessCollection,
RangeReplaceableCollection,
Sequence
where Element: Differentiableextension Array.DifferentiableView: VectorProtocol
where Element: Differentiable & VectorProtocolextension Array.DifferentiableView: PointwiseMultiplicative
where Element: Differentiable & PointwiseMultiplicativeคำประกาศ
public typealias AllKeyPaths = [PartialKeyPath<Array>]
คำประกาศ
public var allKeyPaths: [PartialKeyPath<Array>] { get }
คำประกาศ
public typealias TangentVector =
Array<Element.TangentVector>.DifferentiableViewคำประกาศ
public mutating mutating func move(along direction: TangentVector)
การปิดที่สร้าง
TangentVector
ของศูนย์ที่count
เหมือนกับself
คำประกาศ
public var zeroTangentVectorInitializer: () -> TangentVector { get }
คำประกาศ
public var differentiableVectorView: TangentVector { get }
คำประกาศ
@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
สร้าง
Array
ที่มีรูปร่างและสเกลาร์เหมือนกับอินสแตนซ์numpy.ndarray
ที่ระบุเงื่อนไขเบื้องต้น
ต้องติดตั้งแพ็คเกจ Pythonnumpy
คำประกาศ
public init?(numpy numpyArray: PythonObject)
พารามิเตอร์
numpyArray
อินสแตนซ์
numpy.ndarray
ที่จะแปลงค่าส่งคืน
numpyArray
แปลงเป็นArray
คืนnil
หากnumpyArray
ไม่ใช่ 1-D หรือไม่มีสเกลาร์dtype
ที่เข้ากันได้สร้างอินสแตนซ์
numpy.ndarray
1 มิติที่มีสเกลาร์เหมือนกับArray
นี้เงื่อนไขเบื้องต้น
ต้องติดตั้งแพ็คเกจ Pythonnumpy
คำประกาศ
func makeNumpyArray() -> PythonObject
คำประกาศ
public var pythonObject: PythonObject { get }
คำประกาศ
public init?(_ pythonObject: PythonObject)
รากที่สองของ
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>
สิบยกกำลัง
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
คำประกาศ
public static func log2(_ x: `Self`) -> Array<Element>
ลอการิทึมฐานสิบของ
x
คำประกาศ
public static func log10(_ x: `Self`) -> Array<Element>
log(1 + x)
ประเมินเพื่อรักษาความแม่นยำให้ใกล้เคียงกับศูนย์คำประกาศ
public static func log1p(_ x: `Self`) -> Array<Element>
exp(y log(x))
คำนวณโดยไม่สูญเสียความแม่นยำระดับกลางสำหรับชนิดจำนวนจริง ถ้า
x
เป็นลบ ผลลัพธ์จะเป็น NaN แม้ว่าy
จะมีค่าเป็นจำนวนเต็มก็ตาม สำหรับประเภทที่ซับซ้อน จะมีการตัดกิ่งบนแกนจริงลบคำประกาศ
public static func pow(_ x: `Self`, _ y: `Self`) -> Array<Element>
x
ยกกำลังn
ผลคูณของสำเนา
n
ของx
คำประกาศ
public static func pow(_ x: `Self`, _ n: Int) -> Array<Element>
รากที่
n
ของx
สำหรับชนิดจำนวนจริง ถ้า
x
เป็นลบ และn
เป็นคู่ ผลลัพธ์จะเป็น NaN สำหรับประเภทที่ซับซ้อน จะมีการตัดกิ่งตามแกนจริงลบคำประกาศ
public static func root(_ x: `Self`, _ n: Int) -> Array<Element>
คำประกาศ
public init(_owning tensorHandles: UnsafePointer<CTensorHandle>?, count: Int)
คำประกาศ
public init<C: RandomAccessCollection>(
_handles: C
) where C.Element: _AnyTensorHandle
บันทึก
แฮช SHA1 มีความยาวเพียง 20 ไบต์ ดังนั้นเฉพาะ 20 ไบต์แรกของSIMD32<UInt8>
ที่ส่งคืนจึงไม่ใช่ศูนย์คำประกาศ
func sha1() -> SIMD32<UInt8>
คำประกาศ
func sha512() -> SIMD64<UInt8>
คำนวณ
a || b
ว่าเรากำลังสวมหน้ากากสองชิ้นอยู่ด้วยกันคำประกาศ
public func mergingMask(with other: [Bool]) -> [Bool]
คำประกาศ
func withArrayRef<Result>(_ body: (Int64ArrayRef) throws -> Result) rethrows -> Result
คำประกาศ
func withArrayRef<Result>(_ body: (OpaqueXLATensorArrayRef) throws -> Result) rethrows -> Result
คำประกาศ
func withArrayRef<T, Result>(_ body: (OpaqueXLATensorArrayRef) throws -> Result) rethrows
-> Result
where Element == Tensor<T>
คำประกาศ
func withArrayRef<Result>(_ body: (inout PaddingConfig) -> Result) -> Result