MPSCNNDepthWiseConvolutionDescriptor

Struct MPSCNNDepthWiseConvolutionDescriptor 

Source
pub struct MPSCNNDepthWiseConvolutionDescriptor { /* private fields */ }
Available on crate feature MPSCNNConvolution only.
Expand description

MPSCNNDepthWiseConvolutionDescriptor can be used to create MPSCNNConvolution object that does depthwise convolution

Depthwise convolution applies different filter to each input feature channel i.e. no cross channel mixing. Number of outputFeatureChannels can be greater than number of inputFeatureChannels, in which case convolution expects channelMultipler = outputFeactureChannels/inputFeatureChannels number of filters for each input channel. This means channelMultipler filters are applied to each input feature channel producing channelMultipler output feature channels. All channelMultipler output feature channels produced by single input feature channel are stored togather in output image i.e. output[x,y,k*channelMultiplier + q] = input[x,y,k] * filter[k,q] where * here denotes convolution. group must be 1. Weights array returned by MPSCNNConvolutionDataProvier is interpreted as Weights [inputFeatureChannels] [channelMultiplier] [kH] [kW] = Weights [ inputFeatureChannels * channelMultiplier ] [kH] [kW] = Weights [ outputFeatureChannels ] [kH] [kW]

Currently only channel multipler of 1 is supported i.e. inputFeatureChannels == outputFeatureChannels

See also Apple’s documentation

Implementations§

Source§

impl MPSCNNDepthWiseConvolutionDescriptor

Source

pub unsafe fn channelMultiplier(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

Ratio of outputFeactureChannel to inputFeatureChannels for depthwise convolution i.e. how many output feature channels are produced by each input channel.

Source§

impl MPSCNNDepthWiseConvolutionDescriptor

Methods declared on superclass MPSCNNConvolutionDescriptor.

Source

pub unsafe fn initWithCoder( this: Allocated<Self>, a_decoder: &NSCoder, ) -> Option<Retained<Self>>

Available on crate feature MPSNeuralNetwork only.

<NSSecureCoding

support

§Safety

a_decoder possibly has further requirements.

Source

pub unsafe fn cnnConvolutionDescriptorWithKernelWidth_kernelHeight_inputFeatureChannels_outputFeatureChannels_neuronFilter( kernel_width: NSUInteger, kernel_height: NSUInteger, input_feature_channels: NSUInteger, output_feature_channels: NSUInteger, neuron_filter: Option<&MPSCNNNeuron>, ) -> Retained<Self>

👎Deprecated
Available on crate features MPSNeuralNetwork and MPSCNNKernel and MPSCNNNeuron and MPSCore and MPSKernel only.

This method is deprecated. Please use neuronType, neuronParameterA and neuronParameterB properites to fuse neuron with convolution.

Parameter kernelWidth: The width of the filter window. Must be > 0. Large values will take a long time.

Parameter kernelHeight: The height of the filter window. Must be > 0. Large values will take a long time.

Parameter inputFeatureChannels: The number of feature channels in the input image. Must be >= 1.

Parameter outputFeatureChannels: The number of feature channels in the output image. Must be >= 1.

Parameter neuronFilter: An optional neuron filter that can be applied to the output of convolution.

Returns: A valid MPSCNNConvolutionDescriptor object or nil, if failure.

Source

pub unsafe fn cnnConvolutionDescriptorWithKernelWidth_kernelHeight_inputFeatureChannels_outputFeatureChannels( kernel_width: NSUInteger, kernel_height: NSUInteger, input_feature_channels: NSUInteger, output_feature_channels: NSUInteger, ) -> Retained<Self>

Available on crate feature MPSNeuralNetwork only.

Creates a convolution descriptor.

Parameter kernelWidth: The width of the filter window. Must be > 0. Large values will take a long time.

Parameter kernelHeight: The height of the filter window. Must be > 0. Large values will take a long time.

Parameter inputFeatureChannels: The number of feature channels in the input image. Must be >= 1.

Parameter outputFeatureChannels: The number of feature channels in the output image. Must be >= 1.

Returns: A valid MPSCNNConvolutionDescriptor object or nil, if failure.

Source§

impl MPSCNNDepthWiseConvolutionDescriptor

Methods declared on superclass NSObject.

Source

pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>

Available on crate feature MPSNeuralNetwork only.
Source

pub unsafe fn new() -> Retained<Self>

Available on crate feature MPSNeuralNetwork only.

Methods from Deref<Target = MPSCNNConvolutionDescriptor>§

Source

pub unsafe fn kernelWidth(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

The width of the filter window. The default value is 3. Any positive non-zero value is valid, including even values. The position of the left edge of the filter window is given by offset.x - (kernelWidth>>1)

Source

pub unsafe fn setKernelWidth(&self, kernel_width: NSUInteger)

Available on crate feature MPSNeuralNetwork only.

Setter for kernelWidth.

Source

pub unsafe fn kernelHeight(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

The height of the filter window. The default value is 3. Any positive non-zero value is valid, including even values. The position of the top edge of the filter window is given by offset.y - (kernelHeight>>1)

Source

pub unsafe fn setKernelHeight(&self, kernel_height: NSUInteger)

Available on crate feature MPSNeuralNetwork only.

Setter for kernelHeight.

Source

pub unsafe fn inputFeatureChannels(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

The number of feature channels per pixel in the input image.

Source

pub unsafe fn setInputFeatureChannels(&self, input_feature_channels: NSUInteger)

Available on crate feature MPSNeuralNetwork only.
Source

pub unsafe fn outputFeatureChannels(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

The number of feature channels per pixel in the output image.

Source

pub unsafe fn setOutputFeatureChannels( &self, output_feature_channels: NSUInteger, )

Available on crate feature MPSNeuralNetwork only.
Source

pub unsafe fn strideInPixelsX(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

The output stride (downsampling factor) in the x dimension. The default value is 1.

Source

pub unsafe fn setStrideInPixelsX(&self, stride_in_pixels_x: NSUInteger)

Available on crate feature MPSNeuralNetwork only.

Setter for strideInPixelsX.

Source

pub unsafe fn strideInPixelsY(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

The output stride (downsampling factor) in the y dimension. The default value is 1.

Source

pub unsafe fn setStrideInPixelsY(&self, stride_in_pixels_y: NSUInteger)

Available on crate feature MPSNeuralNetwork only.

Setter for strideInPixelsY.

Source

pub unsafe fn groups(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

Number of groups input and output channels are divided into. The default value is 1. Groups lets you reduce the parameterization. If groups is set to n, input is divided into n groups with inputFeatureChannels/n channels in each group. Similarly output is divided into n groups with outputFeatureChannels/n channels in each group. ith group in input is only connected to ith group in output so number of weights (parameters) needed is reduced by factor of n. Both inputFeatureChannels and outputFeatureChannels must be divisible by n and number of channels in each group must be multiple of 4.

Source

pub unsafe fn setGroups(&self, groups: NSUInteger)

Available on crate feature MPSNeuralNetwork only.

Setter for groups.

Source

pub unsafe fn dilationRateX(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

dilationRateX property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems. Default value is 1. When set to value > 1, original kernel width, kW is dilated to

kW_Dilated = (kW-1)*dilationRateX + 1

by inserting d-1 zeros between consecutive entries in each row of the original kernel. The kernel is centered based on kW_Dilated.

Source

pub unsafe fn setDilationRateX(&self, dilation_rate_x: NSUInteger)

Available on crate feature MPSNeuralNetwork only.

Setter for dilationRateX.

Source

pub unsafe fn dilationRateY(&self) -> NSUInteger

Available on crate feature MPSNeuralNetwork only.

dilationRateY property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems. Default value is 1. When set to value > 1, original kernel height, kH is dilated to

kH_Dilated = (kH-1)*dilationRateY + 1

by inserting d-1 rows of zeros between consecutive row of the original kernel. The kernel is centered based on kH_Dilated.

Source

pub unsafe fn setDilationRateY(&self, dilation_rate_y: NSUInteger)

Available on crate feature MPSNeuralNetwork only.

Setter for dilationRateY.

Source

pub unsafe fn fusedNeuronDescriptor(&self) -> Retained<MPSNNNeuronDescriptor>

Available on crate features MPSNeuralNetwork and MPSCNNNeuron only.

This mathod can be used to add a neuron activation funtion of given type with associated scalar parameters A and B that are shared across all output channels. Neuron activation fucntion is applied to output of convolution. This is a per-pixel operation that is fused with convolution kernel itself for best performance. Note that this method can only be used to fuse neuron of kind for which parameters A and B are shared across all channels of convoution output. It is an error to call this method for neuron activation functions like MPSCNNNeuronTypePReLU, which require per-channel parameter values. For those kind of neuron activation functions, use appropriate setter functions. Default is descriptor with neuronType MPSCNNNeuronTypeNone.

Note: in certain cases the neuron descriptor will be cached by the MPSNNGraph or the MPSCNNConvolution. If the neuron type changes after either is made, behavior is undefined.

Source

pub unsafe fn setFusedNeuronDescriptor( &self, fused_neuron_descriptor: &MPSNNNeuronDescriptor, )

Available on crate features MPSNeuralNetwork and MPSCNNNeuron only.
Source

pub unsafe fn neuron(&self) -> Option<Retained<MPSCNNNeuron>>

👎Deprecated
Available on crate features MPSNeuralNetwork and MPSCNNKernel and MPSCNNNeuron and MPSCore and MPSKernel only.

MPSCNNNeuron filter to be applied as part of convolution. This is applied after BatchNormalization in the end. Default is nil. This is deprecated. You dont need to create MPSCNNNeuron object to fuse with convolution. Use neuron properties in this descriptor.

Source

pub unsafe fn setNeuron(&self, neuron: Option<&MPSCNNNeuron>)

👎Deprecated
Available on crate features MPSNeuralNetwork and MPSCNNKernel and MPSCNNNeuron and MPSCore and MPSKernel only.

Setter for neuron.

Source

pub unsafe fn encodeWithCoder(&self, a_coder: &NSCoder)

Available on crate feature MPSNeuralNetwork only.

<NSSecureCoding

support

§Safety

a_coder possibly has further requirements.

Source

pub unsafe fn setBatchNormalizationParametersForInferenceWithMean_variance_gamma_beta_epsilon( &self, mean: *const c_float, variance: *const c_float, gamma: *const c_float, beta: *const c_float, epsilon: c_float, )

Available on crate feature MPSNeuralNetwork only.

Adds batch normalization for inference, it copies all the float arrays provided, expecting outputFeatureChannels elements in each.

This method will be used to pass in batch normalization parameters to the convolution during the init call. For inference we modify weights and bias going in convolution or Fully Connected layer to combine and optimize the layers.

w: weights for a corresponding output feature channel b: bias for a corresponding output feature channel W: batch normalized weights for a corresponding output feature channel B: batch normalized bias for a corresponding output feature channel

I = gamma / sqrt(variance + epsilon), J = beta - ( I * mean )

W = w * I B = b * I + J

Every convolution has (OutputFeatureChannel * kernelWidth * kernelHeight * InputFeatureChannel) weights

I, J are calculated, for every output feature channel separately to get the corresponding weights and bias Thus, I, J are calculated and then used for every (kernelWidth * kernelHeight * InputFeatureChannel) weights, and this is done OutputFeatureChannel number of times for each output channel.

thus, internally, batch normalized weights are computed as:

W[no][i][j][ni] = w[no][i][j][ni] * I[no]

no: index into outputFeatureChannel i : index into kernel Height j : index into kernel Width ni: index into inputFeatureChannel

One usually doesn’t see a bias term and batch normalization together as batch normalization potentially cancels out the bias term after training, but in MPS if the user provides it, batch normalization will use the above formula to incorporate it, if user does not have bias terms then put a float array of zeroes in the convolution init for bias terms of each output feature channel.

this comes from: https://arxiv.org/pdf/1502.03167v3.pdf

Note: in certain cases the batch normalization parameters will be cached by the MPSNNGraph or the MPSCNNConvolution. If the batch normalization parameters change after either is made, behavior is undefined.

Parameter mean: Pointer to an array of floats of mean for each output feature channel

Parameter variance: Pointer to an array of floats of variance for each output feature channel

Parameter gamma: Pointer to an array of floats of gamma for each output feature channel

Parameter beta: Pointer to an array of floats of beta for each output feature channel

Parameter epsilon: A small float value used to have numerical stability in the code

§Safety
  • mean must be a valid pointer or null.
  • variance must be a valid pointer or null.
  • gamma must be a valid pointer or null.
  • beta must be a valid pointer or null.
Source

pub unsafe fn setNeuronType_parameterA_parameterB( &self, neuron_type: MPSCNNNeuronType, parameter_a: c_float, parameter_b: c_float, )

👎Deprecated
Available on crate features MPSNeuralNetwork and MPSCNNNeuronType only.

Adds a neuron activation function to convolution descriptor.

This mathod can be used to add a neuron activation funtion of given type with associated scalar parameters A and B that are shared across all output channels. Neuron activation fucntion is applied to output of convolution. This is a per-pixel operation that is fused with convolution kernel itself for best performance. Note that this method can only be used to fuse neuron of kind for which parameters A and B are shared across all channels of convoution output. It is an error to call this method for neuron activation functions like MPSCNNNeuronTypePReLU, which require per-channel parameter values. For those kind of neuron activation functions, use appropriate setter functions.

Note: in certain cases, the neuron descriptor will be cached by the MPSNNGraph or the MPSCNNConvolution. If the neuron type changes after either is made, behavior is undefined.

Parameter neuronType: type of neuron activation function. For full list see MPSCNNNeuronType.h

Parameter parameterA: parameterA of neuron activation that is shared across all channels of convolution output.

Parameter parameterB: parameterB of neuron activation that is shared across all channels of convolution output.

Source

pub unsafe fn neuronType(&self) -> MPSCNNNeuronType

👎Deprecated
Available on crate features MPSNeuralNetwork and MPSCNNNeuronType only.

Getter funtion for neuronType set using setNeuronType:parameterA:parameterB method

Source

pub unsafe fn neuronParameterA(&self) -> c_float

👎Deprecated
Available on crate feature MPSNeuralNetwork only.

Getter funtion for neuronType set using setNeuronType:parameterA:parameterB method

Source

pub unsafe fn neuronParameterB(&self) -> c_float

👎Deprecated
Available on crate feature MPSNeuralNetwork only.

Getter funtion for neuronType set using setNeuronType:parameterA:parameterB method

Source

pub unsafe fn setNeuronToPReLUWithParametersA(&self, a: &NSData)

👎Deprecated
Available on crate feature MPSNeuralNetwork only.

Add per-channel neuron parameters A for PReLu neuron activation functions.

This method sets the neuron to PReLU, zeros parameters A and B and sets the per-channel neuron parameters A to an array containing a unique value of A for each output feature channel.

If the neuron function is f(v,a,b), it will apply

OutputImage(x,y,i) = f( ConvolutionResult(x,y,i), A[i], B[i] ) where i in [0,outputFeatureChannels-1]

See https://arxiv.org/pdf/1502.01852.pdf for details.

All other neuron types, where parameter A and parameter B are shared across channels must be set using -setNeuronOfType:parameterA:parameterB:

If batch normalization parameters are set, batch normalization will occur before neuron application i.e. output of convolution is first batch normalized followed by neuron activation. This function automatically sets neuronType to MPSCNNNeuronTypePReLU.

Note: in certain cases the neuron descriptor will be cached by the MPSNNGraph or the MPSCNNConvolution. If the neuron type changes after either is made, behavior is undefined.

Parameter A: An array containing per-channel float values for neuron parameter A. Number of entries must be equal to outputFeatureChannels.

Methods from Deref<Target = NSObject>§

Source

pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !

Handle messages the object doesn’t recognize.

See Apple’s documentation for details.

Methods from Deref<Target = AnyObject>§

Source

pub fn class(&self) -> &'static AnyClass

Dynamically find the class of this object.

§Panics

May panic if the object is invalid (which may be the case for objects returned from unavailable init/new methods).

§Example

Check that an instance of NSObject has the precise class NSObject.

use objc2::ClassType;
use objc2::runtime::NSObject;

let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
Source

pub unsafe fn get_ivar<T>(&self, name: &str) -> &T
where T: Encode,

👎Deprecated: this is difficult to use correctly, use Ivar::load instead.

Use Ivar::load instead.

§Safety

The object must have an instance variable with the given name, and it must be of type T.

See Ivar::load_ptr for details surrounding this.

Source

pub fn downcast_ref<T>(&self) -> Option<&T>
where T: DowncastTarget,

Attempt to downcast the object to a class of type T.

This is the reference-variant. Use Retained::downcast if you want to convert a retained object to another type.

§Mutable classes

Some classes have immutable and mutable variants, such as NSString and NSMutableString.

When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.

So using this method to convert a NSString to a NSMutableString, while not unsound, is generally frowned upon unless you created the string yourself, or the API explicitly documents the string to be mutable.

See Apple’s documentation on mutability and on isKindOfClass: for more details.

§Generic classes

Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.

You can, however, safely downcast to generic collections where all the type-parameters are AnyObject.

§Panics

This works internally by calling isKindOfClass:. That means that the object must have the instance method of that name, and an exception will be thrown (if CoreFoundation is linked) or the process will abort if that is not the case. In the vast majority of cases, you don’t need to worry about this, since both root objects NSObject and NSProxy implement this method.

§Examples

Cast an NSString back and forth from NSObject.

use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};

let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();

Try (and fail) to cast an NSObject to an NSString.

use objc2_foundation::{NSObject, NSString};

let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());

Try to cast to an array of strings.

use objc2_foundation::{NSArray, NSObject, NSString};

let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();

This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.

Downcast when processing each element instead.

use objc2_foundation::{NSArray, NSObject, NSString};

let arr = NSArray::from_retained_slice(&[NSObject::new()]);

for elem in arr {
    if let Some(data) = elem.downcast_ref::<NSString>() {
        // handle `data`
    }
}

Trait Implementations§

Source§

impl AsRef<AnyObject> for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn as_ref(&self) -> &AnyObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<MPSCNNConvolutionDescriptor> for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn as_ref(&self) -> &MPSCNNConvolutionDescriptor

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<MPSCNNDepthWiseConvolutionDescriptor> for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<NSObject> for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn as_ref(&self) -> &NSObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<AnyObject> for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
Source§

impl Borrow<MPSCNNConvolutionDescriptor> for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn borrow(&self) -> &MPSCNNConvolutionDescriptor

Immutably borrows from an owned value. Read more
Source§

impl Borrow<NSObject> for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn borrow(&self) -> &NSObject

Immutably borrows from an owned value. Read more
Source§

impl ClassType for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

const NAME: &'static str = "MPSCNNDepthWiseConvolutionDescriptor"

The name of the Objective-C class that this type represents. Read more
Source§

type Super = MPSCNNConvolutionDescriptor

The superclass of this class. Read more
Source§

type ThreadKind = <<MPSCNNDepthWiseConvolutionDescriptor as ClassType>::Super as ClassType>::ThreadKind

Whether the type can be used from any thread, or from only the main thread. Read more
Source§

fn class() -> &'static AnyClass

Get a reference to the Objective-C class that this type represents. Read more
Source§

fn as_super(&self) -> &Self::Super

Get an immutable reference to the superclass.
Source§

impl CopyingHelper for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

type Result = MPSCNNDepthWiseConvolutionDescriptor

The immutable counterpart of the type, or Self if the type has no immutable counterpart. Read more
Source§

impl Debug for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

type Target = MPSCNNConvolutionDescriptor

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Hash for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn retain(&self) -> Retained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

impl NSCoding for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

unsafe fn encodeWithCoder(&self, coder: &NSCoder)
where Self: Sized + Message,

Safety Read more
Source§

unsafe fn initWithCoder( this: Allocated<Self>, coder: &NSCoder, ) -> Option<Retained<Self>>
where Self: Sized + Message,

Safety Read more
Source§

impl NSCopying for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn copy(&self) -> Retained<Self::Result>
where Self: Sized + Message + CopyingHelper,

Returns a new instance that’s a copy of the receiver. Read more
Source§

unsafe fn copyWithZone(&self, zone: *mut NSZone) -> Retained<Self::Result>
where Self: Sized + Message + CopyingHelper,

Returns a new instance that’s a copy of the receiver. Read more
Source§

impl NSObjectProtocol for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn isEqual(&self, other: Option<&AnyObject>) -> bool
where Self: Sized + Message,

Check whether the object is equal to an arbitrary other object. Read more
Source§

fn hash(&self) -> usize
where Self: Sized + Message,

An integer that can be used as a table address in a hash table structure. Read more
Source§

fn isKindOfClass(&self, cls: &AnyClass) -> bool
where Self: Sized + Message,

Check if the object is an instance of the class, or one of its subclasses. Read more
Source§

fn is_kind_of<T>(&self) -> bool
where T: ClassType, Self: Sized + Message,

👎Deprecated: use isKindOfClass directly, or cast your objects with AnyObject::downcast_ref
Check if the object is an instance of the class type, or one of its subclasses. Read more
Source§

fn isMemberOfClass(&self, cls: &AnyClass) -> bool
where Self: Sized + Message,

Check if the object is an instance of a specific class, without checking subclasses. Read more
Source§

fn respondsToSelector(&self, aSelector: Sel) -> bool
where Self: Sized + Message,

Check whether the object implements or inherits a method with the given selector. Read more
Source§

fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
where Self: Sized + Message,

Check whether the object conforms to a given protocol. Read more
Source§

fn description(&self) -> Retained<NSObject>
where Self: Sized + Message,

A textual representation of the object. Read more
Source§

fn debugDescription(&self) -> Retained<NSObject>
where Self: Sized + Message,

A textual representation of the object to use when debugging. Read more
Source§

fn isProxy(&self) -> bool
where Self: Sized + Message,

Check whether the receiver is a subclass of the NSProxy root class instead of the usual NSObject. Read more
Source§

fn retainCount(&self) -> usize
where Self: Sized + Message,

The reference count of the object. Read more
Source§

impl NSSecureCoding for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

impl PartialEq for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RefEncode for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

const ENCODING_REF: Encoding = <MPSCNNConvolutionDescriptor as ::objc2::RefEncode>::ENCODING_REF

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl DowncastTarget for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.
Source§

impl Eq for MPSCNNDepthWiseConvolutionDescriptor

Available on crate feature MPSNeuralNetwork only.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T> AnyThread for T
where T: ClassType<ThreadKind = dyn AnyThread + 'a> + ?Sized,

Source§

fn alloc() -> Allocated<Self>
where Self: Sized + ClassType,

Allocate a new instance of the class. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,