objc2-ml-compute 0.3.2

Bindings to the MLCompute framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// The MLCMultiheadAttentionDescriptor specifies a Multi-Head Attention descriptor
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcmultiheadattentiondescriptor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated]
    pub struct MLCMultiheadAttentionDescriptor;
);

extern_conformance!(
    unsafe impl NSCopying for MLCMultiheadAttentionDescriptor {}
);

unsafe impl CopyingHelper for MLCMultiheadAttentionDescriptor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for MLCMultiheadAttentionDescriptor {}
);

impl MLCMultiheadAttentionDescriptor {
    extern_methods!(
        #[deprecated]
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[deprecated]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// model or embedding dimension
        #[deprecated]
        #[unsafe(method(modelDimension))]
        #[unsafe(method_family = none)]
        pub unsafe fn modelDimension(&self) -> NSUInteger;

        /// total dimension of key space, Default = modelDimension
        #[deprecated]
        #[unsafe(method(keyDimension))]
        #[unsafe(method_family = none)]
        pub unsafe fn keyDimension(&self) -> NSUInteger;

        /// total dimension of value space, Default = modelDimension
        #[deprecated]
        #[unsafe(method(valueDimension))]
        #[unsafe(method_family = none)]
        pub unsafe fn valueDimension(&self) -> NSUInteger;

        /// number of parallel attention heads
        #[deprecated]
        #[unsafe(method(headCount))]
        #[unsafe(method_family = none)]
        pub unsafe fn headCount(&self) -> NSUInteger;

        /// a droupout layer applied to the output projection weights. Default = 0.0
        #[deprecated]
        #[unsafe(method(dropout))]
        #[unsafe(method_family = none)]
        pub unsafe fn dropout(&self) -> c_float;

        /// if true, bias is used for query/key/value/output projections. Default = true
        #[deprecated]
        #[unsafe(method(hasBiases))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasBiases(&self) -> bool;

        /// if true, an array of biases is added to key and value respectively. Default = false
        #[deprecated]
        #[unsafe(method(hasAttentionBiases))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasAttentionBiases(&self) -> bool;

        /// if true, a row of zeroes is added to projected key and value. Default = false
        #[deprecated]
        #[unsafe(method(addsZeroAttention))]
        #[unsafe(method_family = none)]
        pub unsafe fn addsZeroAttention(&self) -> bool;

        /// A multi-head attention layer descriptor
        ///
        /// Parameter `modelDimension`: total dimension of model space
        ///
        /// Parameter `keyDimension`: total dimension of key space. Default = modelDimension
        ///
        /// Parameter `valueDimension`: total dimension of value space. Default = modelDimension
        ///
        /// Parameter `headCount`: number of parallel attention heads
        ///
        /// Parameter `dropout`: optional, a dropout layer applied to the output projection weights. Default = 0.0f
        ///
        /// Parameter `hasBiases`: if true, bias will be added to query/key/value/output projections. Default = YES
        ///
        /// Parameter `hasAttentionBiases`: if true, an array of biases is added to key and value respectively. Default = NO
        ///
        /// Parameter `addsZeroAttention`: if true, a row of zeroes is added to projected key and value. Default = NO
        ///
        /// Returns: A new MultiheadAttention layer descriptor
        #[deprecated]
        #[unsafe(method(descriptorWithModelDimension:keyDimension:valueDimension:headCount:dropout:hasBiases:hasAttentionBiases:addsZeroAttention:))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptorWithModelDimension_keyDimension_valueDimension_headCount_dropout_hasBiases_hasAttentionBiases_addsZeroAttention(
            model_dimension: NSUInteger,
            key_dimension: NSUInteger,
            value_dimension: NSUInteger,
            head_count: NSUInteger,
            dropout: c_float,
            has_biases: bool,
            has_attention_biases: bool,
            adds_zero_attention: bool,
        ) -> Option<Retained<Self>>;

        /// A multi-head attention layer descriptor
        ///
        /// Parameter `modelDimension`: total dimension of model space
        ///
        /// Parameter `headCount`: number of parallel attention heads
        ///
        /// Returns: A valid MultiheadAttention layer descriptor
        #[deprecated]
        #[unsafe(method(descriptorWithModelDimension:headCount:))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptorWithModelDimension_headCount(
            model_dimension: NSUInteger,
            head_count: NSUInteger,
        ) -> Retained<Self>;
    );
}