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 MLCLSTMDescriptor specifies a LSTM descriptor
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlclstmdescriptor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated]
    pub struct MLCLSTMDescriptor;
);

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

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

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

impl MLCLSTMDescriptor {
    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>;

        /// The number of expected feature channels in the input
        #[deprecated]
        #[unsafe(method(inputSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn inputSize(&self) -> NSUInteger;

        /// The number of feature channels in the hidden state
        #[deprecated]
        #[unsafe(method(hiddenSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn hiddenSize(&self) -> NSUInteger;

        /// The number of recurrent layers.  Default is 1.
        #[deprecated]
        #[unsafe(method(layerCount))]
        #[unsafe(method_family = none)]
        pub unsafe fn layerCount(&self) -> NSUInteger;

        /// If NO, the layer does not use bias terms.  Default is YES.
        #[deprecated]
        #[unsafe(method(usesBiases))]
        #[unsafe(method_family = none)]
        pub unsafe fn usesBiases(&self) -> bool;

        /// LSTM only supports batchFirst=YES. This means the input and output will have shape [batch size, time steps, feature]. Default is YES.
        #[deprecated]
        #[unsafe(method(batchFirst))]
        #[unsafe(method_family = none)]
        pub unsafe fn batchFirst(&self) -> bool;

        /// If YES, becomes a bidirectional LSTM.  Default is NO.
        #[deprecated]
        #[unsafe(method(isBidirectional))]
        #[unsafe(method_family = none)]
        pub unsafe fn isBidirectional(&self) -> bool;

        /// if YES return output for all sequences else return output only for the last sequences. Default: YES
        #[deprecated]
        #[unsafe(method(returnsSequences))]
        #[unsafe(method_family = none)]
        pub unsafe fn returnsSequences(&self) -> bool;

        /// If non-zero, intrdouces a dropout layer on the outputs of each LSTM layer
        /// except the last layer, with dropout probablity equal to dropout.  Default is 0.0.
        #[deprecated]
        #[unsafe(method(dropout))]
        #[unsafe(method_family = none)]
        pub unsafe fn dropout(&self) -> c_float;

        #[cfg(feature = "MLCTypes")]
        /// MLCLSTMResultModeOutput returns output data. MLCLSTMResultModeOutputAndStates returns
        /// output data, last hidden state h_n, and last cell state c_n. Default MLCLSTMResultModeOutput.
        #[deprecated]
        #[unsafe(method(resultMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn resultMode(&self) -> MLCLSTMResultMode;

        /// Creates a LSTM descriptor with batchFirst = YES
        ///
        /// Parameter `inputSize`: The number of expected features in the input
        ///
        /// Parameter `hiddenSize`: The number of features in the hidden state
        ///
        /// Parameter `layerCount`: Number of recurrent layers
        ///
        /// Returns: A valid MLCLSTMDescriptor object or nil, if failure.
        #[deprecated]
        #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount(
            input_size: NSUInteger,
            hidden_size: NSUInteger,
            layer_count: NSUInteger,
        ) -> Retained<Self>;

        /// Creates a LSTM descriptor descriptor with batchFirst = YES
        ///
        /// Parameter `inputSize`: The number of expected features in the input
        ///
        /// Parameter `hiddenSize`: The number of features in the hidden state
        ///
        /// Parameter `layerCount`: Number of recurrent layers
        ///
        /// Parameter `usesBiases`: If NO, the layer does not use bias weights.  Default: YES
        ///
        /// Parameter `isBidirectional`: If YES, becomes a bi-directional LSTM.  Default: NO
        ///
        /// Parameter `dropout`: If non-zero, introduces a dropout layer on the outputs of each LSTM layer except the last layer
        /// with dropout probability equal to dropout.
        ///
        /// Returns: A valid MLCLSTMDescriptor object or nil, if failure.
        #[deprecated]
        #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:usesBiases:isBidirectional:dropout:))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount_usesBiases_isBidirectional_dropout(
            input_size: NSUInteger,
            hidden_size: NSUInteger,
            layer_count: NSUInteger,
            uses_biases: bool,
            is_bidirectional: bool,
            dropout: c_float,
        ) -> Retained<Self>;

        #[deprecated]
        #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:usesBiases:batchFirst:isBidirectional:dropout:))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount_usesBiases_batchFirst_isBidirectional_dropout(
            input_size: NSUInteger,
            hidden_size: NSUInteger,
            layer_count: NSUInteger,
            uses_biases: bool,
            batch_first: bool,
            is_bidirectional: bool,
            dropout: c_float,
        ) -> Retained<Self>;

        #[deprecated]
        #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:usesBiases:batchFirst:isBidirectional:returnsSequences:dropout:))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount_usesBiases_batchFirst_isBidirectional_returnsSequences_dropout(
            input_size: NSUInteger,
            hidden_size: NSUInteger,
            layer_count: NSUInteger,
            uses_biases: bool,
            batch_first: bool,
            is_bidirectional: bool,
            returns_sequences: bool,
            dropout: c_float,
        ) -> Retained<Self>;

        #[cfg(feature = "MLCTypes")]
        /// Creates a LSTM descriptor.
        ///
        /// Parameter `inputSize`: The number of expected features in the input
        ///
        /// Parameter `hiddenSize`: The number of features in the hidden state
        ///
        /// Parameter `layerCount`: Number of recurrent layers
        ///
        /// Parameter `usesBiases`: If NO, the layer does not use bias weights.  Default: YES
        ///
        /// Parameter `batchFirst`: LSTM only supports batchFirst=YES. This means the input and output will have shape [batch size, time steps, feature]. Default is YES.
        ///
        /// Parameter `isBidirectional`: If YES, becomes a bi-directional LSTM.  Default: NO
        ///
        /// Parameter `returnsSequences`: if YES return output for all sequences else return output only for the last sequences. Default: YES
        ///
        /// Parameter `dropout`: If non-zero, introduces a dropout layer on the outputs of each LSTM layer except the last layer
        /// with dropout probability equal to dropout.
        ///
        /// Parameter `resultMode`: expected result tensors. MLCLSTMResultModeOutput returns output data. MLCLSTMResultModeOutputAndStates returns
        /// output data, last hidden state h_n, and last cell state c_n. Default: MLCLSTMResultModeOutput.
        ///
        /// Returns: A valid MLCLSTMDescriptor object or nil, if failure.
        #[deprecated]
        #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:usesBiases:batchFirst:isBidirectional:returnsSequences:dropout:resultMode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount_usesBiases_batchFirst_isBidirectional_returnsSequences_dropout_resultMode(
            input_size: NSUInteger,
            hidden_size: NSUInteger,
            layer_count: NSUInteger,
            uses_biases: bool,
            batch_first: bool,
            is_bidirectional: bool,
            returns_sequences: bool,
            dropout: c_float,
            result_mode: MLCLSTMResultMode,
        ) -> Retained<Self>;
    );
}