@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 }
เข้าถึงขนาดของมิติที่ i
คำประกาศ
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 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 }