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§
Sourceunsafe fn initWithParameterDictionary_error(
this: Allocated<Self>,
parameters: &NSDictionary<NSString, AnyObject>,
) -> Result<Retained<Self>, Retained<NSError>>
unsafe fn initWithParameterDictionary_error( this: Allocated<Self>, parameters: &NSDictionary<NSString, AnyObject>, ) -> Result<Retained<Self>, Retained<NSError>>
§Safety
parameters generic should be of the correct type.
unsafe fn setWeightData_error( &self, weights: &NSArray<NSData>, ) -> Result<(), Retained<NSError>>
unsafe fn outputShapesForInputShapes_error( &self, input_shapes: &NSArray<NSArray<NSNumber>>, ) -> Result<Retained<NSArray<NSArray<NSNumber>>>, Retained<NSError>>
unsafe fn evaluateOnCPUWithInputs_outputs_error( &self, inputs: &NSArray<MLMultiArray>, outputs: &NSArray<MLMultiArray>, ) -> Result<(), Retained<NSError>>
Available on crate feature
MLMultiArray only.Sourceunsafe fn encodeToCommandBuffer_inputs_outputs_error(
&self,
command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
inputs: &NSArray<ProtocolObject<dyn MTLTexture>>,
outputs: &NSArray<ProtocolObject<dyn MTLTexture>>,
) -> Result<(), Retained<NSError>>
Available on crate feature objc2-metal and non-watchOS only.
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>>
objc2-metal and non-watchOS only.§Safety
inputsgeneric may need to be synchronized.inputsgeneric may be unretained, you must ensure it is kept alive while in use.outputsgeneric may need to be synchronized.outputsgeneric may be unretained, you must ensure it is kept alive while in use.