Group
public struct Group<Element: DynamicGraph.AnyTensor>: RandomAccessCollection, DynamicGraph
.AnyGroup
extension DynamicGraph.Group: DynamicGraph_AnyTensor where Element: DynamicGraph.AnyTensor
extension DynamicGraph.Group: DynamicGraph.AnyTensorGroup where Element: DynamicGraph.AnyTensor
extension DynamicGraph.Group: DynamicGraph.TensorGroup
where Element: _DynamicGraph_TensorGroup, Element: DynamicGraph.AnyTensor
Type-aware group of tensors.
-
Undocumented
Declaration
Swift
public var untyped: [DynamicGraph.AnyTensor] { get }
-
Declaration
Swift
public typealias Element = Element
-
Declaration
Swift
public typealias Index = Int
-
Declaration
Swift
public typealias Indices = Range<Index>
-
Declaration
Swift
public typealias SubSequence = Array<Element>.SubSequence
-
Declaration
Swift
public var endIndex: Index { get }
-
Declaration
Swift
public var indices: Indices { get }
-
Declaration
Swift
public var startIndex: Index { get }
-
Declaration
Swift
public func formIndex(after i: inout Index)
-
Declaration
Swift
public func formIndex(before i: inout Index)
-
Declaration
Swift
public subscript(x: Indices) -> SubSequence { get }
-
Undocumented
Declaration
Swift
public init(_ elements: Element...)
-
Undocumented
Declaration
Swift
public init<OtherElement>(_ otherGroup: Group<OtherElement>) where OtherElement : DynamicGraph.AnyTensor
-
Undocumented
Declaration
Swift
public init(_ underlyingArray: [Element])
-
Compute gradients from this tensor to the source tensors.
Declaration
Swift
public func backward<S: Sequence>(to tensors: S, streamContext: StreamContext? = nil) where S.Element: DynamicGraph.AnyGroup
Parameters
to
The source tensors to this tensor.
streamContext
The stream context to perform such operation.
-
Compute gradients from this tensor to the source tensor.
Declaration
Swift
public func backward<Group: DynamicGraph.AnyGroup>( to tensor: Group, streamContext: StreamContext? = nil )
Parameters
to
The source tensor to this tensor.
streamContext
The stream context to perform such operation.
-
Transpose from axisA to axisB.
Declaration
Swift
public func transpose(_ axisA: Int, _ axisB: Int, streamContext: StreamContext? = nil) -> DynamicGraph.Group<Element>
-
Fill the given tensor with uniform random values.
Declaration
Swift
public func rand( _ lowerBound: Float = 0, _ upperBound: Float = 1, streamContext: StreamContext? = nil )
-
Undocumented
Declaration
Swift
public static func upcasting(from: DynamicGraph_Any) -> DynamicGraph_AnyTensor
-
Undocumented
Declaration
Swift
public typealias AnyTensor = DynamicGraph.Group<DynamicGraph.AnyTensor>
-
Undocumented
Declaration
Swift
public static func exec( cmd: ccv_nnc_cmd_t, hint: ccv_nnc_hint_t, inputs: [AnyTensor], outputSize: Int32, streamContext: StreamContext? ) -> [AnyTensor]
-
Undocumented
Declaration
Swift
public static func exec( cmd: ccv_nnc_cmd_t, hint: ccv_nnc_hint_t, inputs: [AnyTensor], outputs: [AnyTensor], streamContext: StreamContext? )
-
Undocumented
Declaration
Swift
public static func evaluate( model: OpaquePointer, isTest: Bool, dataParallel: inout Int?, inputs: [AnyTensor], outputSize: Int32, streamContext: StreamContext? ) -> [AnyTensor]
-
Undocumented
Declaration
Swift
public typealias ElementNumeric = Element._Element
-
Undocumented
Declaration
Swift
public func reshape( format: TensorFormat, dimensions: [Int], offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( _ dimensionFormat: TensorDimensionFormat, offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( format: TensorFormat, dimensions: [Int], offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( _ dimensionFormat: TensorDimensionFormat, offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( format: TensorFormat, dimensions: [Int], offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( _ dimensionFormat: TensorDimensionFormat, offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( format: TensorFormat, dimensions: [Int], offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( _ dimensionFormat: TensorDimensionFormat, offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( format: TensorFormat, dimensions: [Int], offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( _ dimensionFormat: TensorDimensionFormat, offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( format: TensorFormat, dimensions: [Int], offset: [Int]? = nil, increments: [Int]? = nil ) -> Self
-
Undocumented
Declaration
Swift
public func reshape( _ dimensionFormat: TensorDimensionFormat, offset: [Int]? = nil, increments: [Int]? = nil ) -> Self