Class MLCMultiheadAttentionLayer

  • All Implemented Interfaces:
    NSObject

    @Deprecated
    public class MLCMultiheadAttentionLayer
    extends MLCLayer
    Deprecated.
    MLCMultiheadAttentionLayer A multi-head attention layer A multi-head "Scaled Dot-Product Attention" layer which attends to one or more entries in the input key-value pairs N=Batch, S=source length, L=target length, E = model(embedding) dimension, K = Key dimension, V = value dimension H = headCount. The sources to this layer are of shapes: Query:(N,L,E), Key:(N,S,K), Value:(N,S,V), KeyMask:(N,S), AttentionMask:(1,L,S) or (NxH,L,S). KeyMask and AttentionMask are optional and either, both or none of them can be passed. KeyMask is of Boolean type and AttentionMask can be of Float or Boolean type. Output is of shape:(N,L,E). For details refer to: https://pytorch.org/docs/stable/nn.html#multiheadattention API-Since: 14.0 Deprecated-Since: 100000.0 Deprecated-Message: Use Metal Performance Shaders Graph or BNNS instead.
    • Constructor Detail

      • MLCMultiheadAttentionLayer

        protected MLCMultiheadAttentionLayer​(org.moe.natj.general.Pointer peer)
        Deprecated.
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
        Deprecated.
      • attentionBiases

        @Nullable
        public @Nullable NSArray<? extends MLCTensor> attentionBiases()
        Deprecated.
        [@property] attentionBiases The biases added to key and value
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
        Deprecated.
      • biases

        @Nullable
        public @Nullable NSArray<? extends MLCTensor> biases()
        Deprecated.
        [@property] biases The biases of query, key, value and output projections
      • biasesParameters

        @Nullable
        public @Nullable NSArray<? extends MLCTensorParameter> biasesParameters()
        Deprecated.
        [@property] biasesParameters The biases tensor parameters used for optimizer update
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
        Deprecated.
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
        Deprecated.
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
        Deprecated.
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
        Deprecated.
      • debugDescription_static

        public static java.lang.String debugDescription_static()
        Deprecated.
      • description_static

        public static java.lang.String description_static()
        Deprecated.
      • descriptor

        @NotNull
        public @NotNull MLCMultiheadAttentionDescriptor descriptor()
        Deprecated.
        [@property] descriptor The multi-head attention descriptor
      • hash_static

        public static long hash_static()
        Deprecated.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
        Deprecated.
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
        Deprecated.
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
        Deprecated.
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
        Deprecated.
      • layerWithDescriptorWeightsBiasesAttentionBiases

        public static MLCMultiheadAttentionLayer layerWithDescriptorWeightsBiasesAttentionBiases​(@NotNull
                                                                                                 @NotNull MLCMultiheadAttentionDescriptor descriptor,
                                                                                                 @NotNull
                                                                                                 @NotNull NSArray<? extends MLCTensor> weights,
                                                                                                 @Nullable
                                                                                                 @Nullable NSArray<? extends MLCTensor> biases,
                                                                                                 @Nullable
                                                                                                 @Nullable NSArray<? extends MLCTensor> attentionBiases)
        Deprecated.
        Create a multi-head attention layer
        Parameters:
        weights - weights corresponding to query, key, value and output projections for all heads
        biases - Optional, biases corresponding to query, key, value and output projections for all heads
        attentionBiases - Optional, An array of biases added to the key and value respectively
        Returns:
        A new MultiheadAttention layer
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
        Deprecated.
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
        Deprecated.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
        Deprecated.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
        Deprecated.
      • supportsDataTypeOnDevice

        public static boolean supportsDataTypeOnDevice​(int dataType,
                                                       @NotNull
                                                       @NotNull MLCDevice device)
        Deprecated.
      • version_static

        public static long version_static()
        Deprecated.
      • weights

        @NotNull
        public @NotNull NSArray<? extends MLCTensor> weights()
        Deprecated.
        [@property] weights The weights of query, key, value and output projections
      • weightsParameters

        @NotNull
        public @NotNull NSArray<? extends MLCTensorParameter> weightsParameters()
        Deprecated.
        [@property] weightsParameters The weights tensor parameters used for optimizer update
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.