Skip to main content

MLCustomLayer

Trait MLCustomLayer 

Source
pub unsafe trait MLCustomLayer {
    // Provided methods
    unsafe fn initWithParameterDictionary_error(
        this: Allocated<Self>,
        parameters: &NSDictionary<NSString, AnyObject>,
    ) -> Result<Retained<Self>, Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn setWeightData_error(
        &self,
        weights: &NSArray<NSData>,
    ) -> Result<(), Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn outputShapesForInputShapes_error(
        &self,
        input_shapes: &NSArray<NSArray<NSNumber>>,
    ) -> Result<Retained<NSArray<NSArray<NSNumber>>>, Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn evaluateOnCPUWithInputs_outputs_error(
        &self,
        inputs: &NSArray<MLMultiArray>,
        outputs: &NSArray<MLMultiArray>,
    ) -> Result<(), Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn encodeToCommandBuffer_inputs_outputs_error(
        &self,
        command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
        inputs: &NSArray<ProtocolObject<dyn MTLTexture>>,
        outputs: &NSArray<ProtocolObject<dyn MTLTexture>>,
    ) -> Result<(), Retained<NSError>>
       where Self: Sized + Message { ... }
}
Available on crate feature MLCustomLayer only.
Expand description

Provided Methods§

Source

unsafe fn initWithParameterDictionary_error( this: Allocated<Self>, parameters: &NSDictionary<NSString, AnyObject>, ) -> Result<Retained<Self>, Retained<NSError>>
where Self: Sized + Message,

§Safety

parameters generic should be of the correct type.

Source

unsafe fn setWeightData_error( &self, weights: &NSArray<NSData>, ) -> Result<(), Retained<NSError>>
where Self: Sized + Message,

Source

unsafe fn outputShapesForInputShapes_error( &self, input_shapes: &NSArray<NSArray<NSNumber>>, ) -> Result<Retained<NSArray<NSArray<NSNumber>>>, Retained<NSError>>
where Self: Sized + Message,

Source

unsafe fn evaluateOnCPUWithInputs_outputs_error( &self, inputs: &NSArray<MLMultiArray>, outputs: &NSArray<MLMultiArray>, ) -> Result<(), Retained<NSError>>
where Self: Sized + Message,

Available on crate feature MLMultiArray only.
Source

unsafe fn encodeToCommandBuffer_inputs_outputs_error( &self, command_buffer: &ProtocolObject<dyn MTLCommandBuffer>, inputs: &NSArray<ProtocolObject<dyn MTLTexture>>, outputs: &NSArray<ProtocolObject<dyn MTLTexture>>, ) -> Result<(), Retained<NSError>>
where Self: Sized + Message,

Available on crate feature objc2-metal and non-watchOS only.
§Safety
  • inputs generic may need to be synchronized.
  • inputs generic may be unretained, you must ensure it is kept alive while in use.
  • outputs generic may need to be synchronized.
  • outputs generic may be unretained, you must ensure it is kept alive while in use.

Trait Implementations§

Source§

impl<T> ImplementedBy<T> for dyn MLCustomLayer
where T: ?Sized + Message + MLCustomLayer,

Source§

impl ProtocolType for dyn MLCustomLayer

Source§

const NAME: &'static str = "MLCustomLayer"

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

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> MLCustomLayer for ProtocolObject<T>
where T: ?Sized + MLCustomLayer,

Implementors§