TensorShape

@frozen
public struct TensorShape : ExpressibleByArrayLiteral
extension TensorShape: Collection, MutableCollection
extension TensorShape: RandomAccessCollection
extension TensorShape: RangeReplaceableCollection
extension TensorShape: Equatable
extension TensorShape: Codable
extension TensorShape: CustomStringConvertible

هيكل يمثل شكل موتر.

TensorShape عبارة عن غلاف رفيع حول مجموعة من الأعداد الصحيحة التي تمثل أبعاد الشكل. تستخدم جميع أنواع الموترات TensorShape لتمثيل شكلها.

  • أبعاد الشكل.

    تصريح

    public var dimensions: [Int]
  • التهيئة مع مجموعة من الأبعاد. رتبة الموتر هي طول المصفوفة.

    تصريح

    public init(_ dimensions: [Int])

    حدود

    dimensions

    أبعاد الشكل.

  • التهيئة مع مجموعة من الأبعاد. رتبة الموتر هي طول المجموعة.

    تصريح

    public init<C>(_ dimensions: C) where C : Collection, C.Element == Int

    حدود

    dimensions

    أبعاد الشكل.

  • قم بالتهيئة بمصفوفة حرفية تمثل أبعاد الشكل. رتبة الموتر هي عدد الأبعاد.

    تصريح

    public init(arrayLiteral elements: Int...)

    حدود

    dimensions

    أبعاد الشكل.

  • قم بالتهيئة باستخدام عناصر متغيرة تمثل أبعاد الشكل. رتبة الموتر هي عدد العناصر.

    تصريح

    public init(_ elements: Int...)

    حدود

    dimensions

    أبعاد الشكل.

  • تصريح

    public init(repeating repeatedValue: Int, count: Int)
  • رتبة الشكل (أي عدد الأبعاد).

    تصريح

    public var rank: Int { get }
  • حجم الشكل كمصفوفة مخزنة بشكل متجاور.

    تصريح

    public var contiguousSize: Int { get }
  • تصريح

    public typealias Element = Int
  • تصريح

    public typealias Index = Int
  • تصريح

    public typealias Indices = Range<Int>
  • رتبة الشكل (أي عدد الأبعاد).

    تصريح

    public var count: Int { get }
  • تصريح

    public var indices: Indices { get }
  • تصريح

    public var startIndex: Index { get }
  • تصريح

    public var endIndex: Index { get }
  • تصريح

    public func index(after i: Index) -> Index
  • الوصول إلى حجم البعد الأول.

    تصريح

    public subscript(position: Index) -> Element { get set }

    حدود

    position

    مؤشر البعد.

  • الوصول إلى حجم البعد الأول.

    تصريح

    public subscript(bounds: Range<Int>) -> TensorShape { get set }

    حدود

    index

    مؤشر البعد.

  • تصريح

    public func index(_ i: Int, offsetBy distance: Int) -> Int
  • تصريح

    public func distance(from start: Int, to end: Int) -> Int
  • تصريح

    public typealias SubSequence = `Self`
  • تصريح

    public init()
  • تصريح

    public mutating mutating func append(_ newElement: Element)
  • تصريح

    public mutating mutating func append(contentsOf newElements: TensorShape)
  • تصريح

    public mutating mutating func append<S>(contentsOf newElements: S) where S : Sequence, S.Element == TensorShape.Element
  • تصريح

    public mutating func replaceSubrange<C>(
      _ subrange: Range<Index>, with newElements: C
    ) where C: Collection, Element == C.Element
  • تصريح

    public static func == (lhs: TensorShape, rhs: TensorShape) -> Bool
  • تصريح

    public func encode(to encoder: Encoder) throws
  • تصريح

    public init(from decoder: Decoder) throws
  • تصريح

    public var description: String { get }