AnyTensor
public class AnyTensor
extension DynamicGraph.AnyTensor: CustomStringConvertible
extension DynamicGraph.AnyTensor: DynamicGraph_AnyTensor
extension DynamicGraph.AnyTensor: DynamicGraph.AnyTensorGroup
extension DynamicGraph.AnyTensor: DynamicGraph_Any
A type-erased tensor variable.
-
Undocumented
Declaration
Swift
public var grad: AnyTensor?
-
Undocumented
Declaration
Swift
public var requiresGrad: Bool { get set }
-
Undocumented
Declaration
Swift
public required init(_ tensor: AnyTensor)
-
Undocumented
Declaration
Swift
public var dimensions: [Int] { get }
-
A constant tensor can only be used as input, you cannot compute gradients for a constant tensor.
Declaration
Swift
public var isConstant: Bool { get }
-
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.AnyTensor
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(to tensor: DynamicGraph.AnyTensor, streamContext: StreamContext? = nil)
Parameters
to
The source tensor to this tensor.
streamContext
The stream context to perform such operation.
-
Declaration
Swift
public var description: String { get }
-
Undocumented
Declaration
Swift
public static func upcasting(from: DynamicGraph_Any) -> DynamicGraph_AnyTensor
-
Undocumented
Declaration
Swift
public typealias AnyTensor = 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]