ScaledDotProductAttention
public final class ScaledDotProductAttention : Model
Scaled-dot-product-attention model.
-
Declaration
Swift
public init( scale: Float, isCausal: Bool = false, hasAttentionMask: Bool = false, upcast: Bool = false, multiHeadOutputProjectionFused: Bool = false, noBias: Bool = false, trainable: Bool? = nil, name: String = "" )
-
Declaration
Swift
public func callAsFunction<T: DynamicGraph.TensorGroup>( queries q: T, keys k: T, values v: T, attentionMask: T? = nil, streamContext: StreamContext? = nil ) -> T