pub struct Layer { /* private fields */ }
Expand description
This interface class allows to build new Layers - are building blocks of networks.
Each class, derived from Layer, must implement allocate() methods to declare own outputs and forward() to compute outputs. Also before using the new layer into networks you must register your layer by using one of @ref dnnLayerFactory “LayerFactory” macros.
Implementations
Trait Implementations
sourceimpl AlgorithmTrait for Layer
impl AlgorithmTrait for Layer
sourceimpl AlgorithmTraitConst for Layer
impl AlgorithmTraitConst for Layer
fn as_raw_Algorithm(&self) -> *const c_void
sourcefn write(&self, fs: &mut FileStorage) -> Result<()>
fn write(&self, fs: &mut FileStorage) -> Result<()>
Stores algorithm parameters in a file storage
sourcefn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
simplified API for language bindings Stores algorithm parameters in a file storage Read more
sourcefn empty(&self) -> Result<bool>
fn empty(&self) -> Result<bool>
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
sourcefn save(&self, filename: &str) -> Result<()>
fn save(&self, filename: &str) -> Result<()>
Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs). Read more
sourcefn get_default_name(&self) -> Result<String>
fn get_default_name(&self) -> Result<String>
Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string. Read more
sourceimpl Boxed for Layer
impl Boxed for Layer
sourceimpl From<AccumLayer> for Layer
impl From<AccumLayer> for Layer
sourcefn from(s: AccumLayer) -> Self
fn from(s: AccumLayer) -> Self
Converts to this type from the input type.
sourceimpl From<AcoshLayer> for Layer
impl From<AcoshLayer> for Layer
sourcefn from(s: AcoshLayer) -> Self
fn from(s: AcoshLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ActivationLayer> for Layer
impl From<ActivationLayer> for Layer
sourcefn from(s: ActivationLayer) -> Self
fn from(s: ActivationLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ActivationLayerInt8> for Layer
impl From<ActivationLayerInt8> for Layer
sourcefn from(s: ActivationLayerInt8) -> Self
fn from(s: ActivationLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<AsinhLayer> for Layer
impl From<AsinhLayer> for Layer
sourcefn from(s: AsinhLayer) -> Self
fn from(s: AsinhLayer) -> Self
Converts to this type from the input type.
sourceimpl From<AtanhLayer> for Layer
impl From<AtanhLayer> for Layer
sourcefn from(s: AtanhLayer) -> Self
fn from(s: AtanhLayer) -> Self
Converts to this type from the input type.
sourceimpl From<BaseConvolutionLayer> for Layer
impl From<BaseConvolutionLayer> for Layer
sourcefn from(s: BaseConvolutionLayer) -> Self
fn from(s: BaseConvolutionLayer) -> Self
Converts to this type from the input type.
sourceimpl From<BatchNormLayer> for Layer
impl From<BatchNormLayer> for Layer
sourcefn from(s: BatchNormLayer) -> Self
fn from(s: BatchNormLayer) -> Self
Converts to this type from the input type.
sourceimpl From<BatchNormLayerInt8> for Layer
impl From<BatchNormLayerInt8> for Layer
sourcefn from(s: BatchNormLayerInt8) -> Self
fn from(s: BatchNormLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<BlankLayer> for Layer
impl From<BlankLayer> for Layer
sourcefn from(s: BlankLayer) -> Self
fn from(s: BlankLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ChannelsPReLULayer> for Layer
impl From<ChannelsPReLULayer> for Layer
sourcefn from(s: ChannelsPReLULayer) -> Self
fn from(s: ChannelsPReLULayer) -> Self
Converts to this type from the input type.
sourceimpl From<CompareLayer> for Layer
impl From<CompareLayer> for Layer
sourcefn from(s: CompareLayer) -> Self
fn from(s: CompareLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ConcatLayer> for Layer
impl From<ConcatLayer> for Layer
sourcefn from(s: ConcatLayer) -> Self
fn from(s: ConcatLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ConstLayer> for Layer
impl From<ConstLayer> for Layer
sourcefn from(s: ConstLayer) -> Self
fn from(s: ConstLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ConvolutionLayer> for Layer
impl From<ConvolutionLayer> for Layer
sourcefn from(s: ConvolutionLayer) -> Self
fn from(s: ConvolutionLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ConvolutionLayerInt8> for Layer
impl From<ConvolutionLayerInt8> for Layer
sourcefn from(s: ConvolutionLayerInt8) -> Self
fn from(s: ConvolutionLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<CorrelationLayer> for Layer
impl From<CorrelationLayer> for Layer
sourcefn from(s: CorrelationLayer) -> Self
fn from(s: CorrelationLayer) -> Self
Converts to this type from the input type.
sourceimpl From<CropAndResizeLayer> for Layer
impl From<CropAndResizeLayer> for Layer
sourcefn from(s: CropAndResizeLayer) -> Self
fn from(s: CropAndResizeLayer) -> Self
Converts to this type from the input type.
sourceimpl From<CumSumLayer> for Layer
impl From<CumSumLayer> for Layer
sourcefn from(s: CumSumLayer) -> Self
fn from(s: CumSumLayer) -> Self
Converts to this type from the input type.
sourceimpl From<DataAugmentationLayer> for Layer
impl From<DataAugmentationLayer> for Layer
sourcefn from(s: DataAugmentationLayer) -> Self
fn from(s: DataAugmentationLayer) -> Self
Converts to this type from the input type.
sourceimpl From<DeconvolutionLayer> for Layer
impl From<DeconvolutionLayer> for Layer
sourcefn from(s: DeconvolutionLayer) -> Self
fn from(s: DeconvolutionLayer) -> Self
Converts to this type from the input type.
sourceimpl From<DequantizeLayer> for Layer
impl From<DequantizeLayer> for Layer
sourcefn from(s: DequantizeLayer) -> Self
fn from(s: DequantizeLayer) -> Self
Converts to this type from the input type.
sourceimpl From<DetectionOutputLayer> for Layer
impl From<DetectionOutputLayer> for Layer
sourcefn from(s: DetectionOutputLayer) -> Self
fn from(s: DetectionOutputLayer) -> Self
Converts to this type from the input type.
sourceimpl From<EltwiseLayer> for Layer
impl From<EltwiseLayer> for Layer
sourcefn from(s: EltwiseLayer) -> Self
fn from(s: EltwiseLayer) -> Self
Converts to this type from the input type.
sourceimpl From<EltwiseLayerInt8> for Layer
impl From<EltwiseLayerInt8> for Layer
sourcefn from(s: EltwiseLayerInt8) -> Self
fn from(s: EltwiseLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<FlattenLayer> for Layer
impl From<FlattenLayer> for Layer
sourcefn from(s: FlattenLayer) -> Self
fn from(s: FlattenLayer) -> Self
Converts to this type from the input type.
sourceimpl From<FloorLayer> for Layer
impl From<FloorLayer> for Layer
sourcefn from(s: FloorLayer) -> Self
fn from(s: FloorLayer) -> Self
Converts to this type from the input type.
sourceimpl From<FlowWarpLayer> for Layer
impl From<FlowWarpLayer> for Layer
sourcefn from(s: FlowWarpLayer) -> Self
fn from(s: FlowWarpLayer) -> Self
Converts to this type from the input type.
sourceimpl From<HardSigmoidLayer> for Layer
impl From<HardSigmoidLayer> for Layer
sourcefn from(s: HardSigmoidLayer) -> Self
fn from(s: HardSigmoidLayer) -> Self
Converts to this type from the input type.
sourceimpl From<HardSwishLayer> for Layer
impl From<HardSwishLayer> for Layer
sourcefn from(s: HardSwishLayer) -> Self
fn from(s: HardSwishLayer) -> Self
Converts to this type from the input type.
sourceimpl From<InnerProductLayer> for Layer
impl From<InnerProductLayer> for Layer
sourcefn from(s: InnerProductLayer) -> Self
fn from(s: InnerProductLayer) -> Self
Converts to this type from the input type.
sourceimpl From<InnerProductLayerInt8> for Layer
impl From<InnerProductLayerInt8> for Layer
sourcefn from(s: InnerProductLayerInt8) -> Self
fn from(s: InnerProductLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<InterpLayer> for Layer
impl From<InterpLayer> for Layer
sourcefn from(s: InterpLayer) -> Self
fn from(s: InterpLayer) -> Self
Converts to this type from the input type.
sourceimpl From<MaxUnpoolLayer> for Layer
impl From<MaxUnpoolLayer> for Layer
sourcefn from(s: MaxUnpoolLayer) -> Self
fn from(s: MaxUnpoolLayer) -> Self
Converts to this type from the input type.
sourceimpl From<NormalizeBBoxLayer> for Layer
impl From<NormalizeBBoxLayer> for Layer
sourcefn from(s: NormalizeBBoxLayer) -> Self
fn from(s: NormalizeBBoxLayer) -> Self
Converts to this type from the input type.
sourceimpl From<PaddingLayer> for Layer
impl From<PaddingLayer> for Layer
sourcefn from(s: PaddingLayer) -> Self
fn from(s: PaddingLayer) -> Self
Converts to this type from the input type.
sourceimpl From<PermuteLayer> for Layer
impl From<PermuteLayer> for Layer
sourcefn from(s: PermuteLayer) -> Self
fn from(s: PermuteLayer) -> Self
Converts to this type from the input type.
sourceimpl From<PoolingLayer> for Layer
impl From<PoolingLayer> for Layer
sourcefn from(s: PoolingLayer) -> Self
fn from(s: PoolingLayer) -> Self
Converts to this type from the input type.
sourceimpl From<PoolingLayerInt8> for Layer
impl From<PoolingLayerInt8> for Layer
sourcefn from(s: PoolingLayerInt8) -> Self
fn from(s: PoolingLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<PowerLayer> for Layer
impl From<PowerLayer> for Layer
sourcefn from(s: PowerLayer) -> Self
fn from(s: PowerLayer) -> Self
Converts to this type from the input type.
sourceimpl From<PriorBoxLayer> for Layer
impl From<PriorBoxLayer> for Layer
sourcefn from(s: PriorBoxLayer) -> Self
fn from(s: PriorBoxLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ProposalLayer> for Layer
impl From<ProposalLayer> for Layer
sourcefn from(s: ProposalLayer) -> Self
fn from(s: ProposalLayer) -> Self
Converts to this type from the input type.
sourceimpl From<QuantizeLayer> for Layer
impl From<QuantizeLayer> for Layer
sourcefn from(s: QuantizeLayer) -> Self
fn from(s: QuantizeLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ReLU6Layer> for Layer
impl From<ReLU6Layer> for Layer
sourcefn from(s: ReLU6Layer) -> Self
fn from(s: ReLU6Layer) -> Self
Converts to this type from the input type.
sourceimpl From<ReciprocalLayer> for Layer
impl From<ReciprocalLayer> for Layer
sourcefn from(s: ReciprocalLayer) -> Self
fn from(s: ReciprocalLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ReduceLayer> for Layer
impl From<ReduceLayer> for Layer
sourcefn from(s: ReduceLayer) -> Self
fn from(s: ReduceLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ReduceLayerInt8> for Layer
impl From<ReduceLayerInt8> for Layer
sourcefn from(s: ReduceLayerInt8) -> Self
fn from(s: ReduceLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<RegionLayer> for Layer
impl From<RegionLayer> for Layer
sourcefn from(s: RegionLayer) -> Self
fn from(s: RegionLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ReorgLayer> for Layer
impl From<ReorgLayer> for Layer
sourcefn from(s: ReorgLayer) -> Self
fn from(s: ReorgLayer) -> Self
Converts to this type from the input type.
sourceimpl From<RequantizeLayer> for Layer
impl From<RequantizeLayer> for Layer
sourcefn from(s: RequantizeLayer) -> Self
fn from(s: RequantizeLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ReshapeLayer> for Layer
impl From<ReshapeLayer> for Layer
sourcefn from(s: ReshapeLayer) -> Self
fn from(s: ReshapeLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ResizeLayer> for Layer
impl From<ResizeLayer> for Layer
sourcefn from(s: ResizeLayer) -> Self
fn from(s: ResizeLayer) -> Self
Converts to this type from the input type.
sourceimpl From<RoundLayer> for Layer
impl From<RoundLayer> for Layer
sourcefn from(s: RoundLayer) -> Self
fn from(s: RoundLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ScaleLayer> for Layer
impl From<ScaleLayer> for Layer
sourcefn from(s: ScaleLayer) -> Self
fn from(s: ScaleLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ScaleLayerInt8> for Layer
impl From<ScaleLayerInt8> for Layer
sourcefn from(s: ScaleLayerInt8) -> Self
fn from(s: ScaleLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<ShiftLayer> for Layer
impl From<ShiftLayer> for Layer
sourcefn from(s: ShiftLayer) -> Self
fn from(s: ShiftLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ShiftLayerInt8> for Layer
impl From<ShiftLayerInt8> for Layer
sourcefn from(s: ShiftLayerInt8) -> Self
fn from(s: ShiftLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<ShrinkLayer> for Layer
impl From<ShrinkLayer> for Layer
sourcefn from(s: ShrinkLayer) -> Self
fn from(s: ShrinkLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ShuffleChannelLayer> for Layer
impl From<ShuffleChannelLayer> for Layer
sourcefn from(s: ShuffleChannelLayer) -> Self
fn from(s: ShuffleChannelLayer) -> Self
Converts to this type from the input type.
sourceimpl From<SigmoidLayer> for Layer
impl From<SigmoidLayer> for Layer
sourcefn from(s: SigmoidLayer) -> Self
fn from(s: SigmoidLayer) -> Self
Converts to this type from the input type.
sourceimpl From<SliceLayer> for Layer
impl From<SliceLayer> for Layer
sourcefn from(s: SliceLayer) -> Self
fn from(s: SliceLayer) -> Self
Converts to this type from the input type.
sourceimpl From<SoftmaxLayer> for Layer
impl From<SoftmaxLayer> for Layer
sourcefn from(s: SoftmaxLayer) -> Self
fn from(s: SoftmaxLayer) -> Self
Converts to this type from the input type.
sourceimpl From<SoftmaxLayerInt8> for Layer
impl From<SoftmaxLayerInt8> for Layer
sourcefn from(s: SoftmaxLayerInt8) -> Self
fn from(s: SoftmaxLayerInt8) -> Self
Converts to this type from the input type.
sourceimpl From<SoftplusLayer> for Layer
impl From<SoftplusLayer> for Layer
sourcefn from(s: SoftplusLayer) -> Self
fn from(s: SoftplusLayer) -> Self
Converts to this type from the input type.
sourceimpl From<SoftsignLayer> for Layer
impl From<SoftsignLayer> for Layer
sourcefn from(s: SoftsignLayer) -> Self
fn from(s: SoftsignLayer) -> Self
Converts to this type from the input type.
sourceimpl From<SplitLayer> for Layer
impl From<SplitLayer> for Layer
sourcefn from(s: SplitLayer) -> Self
fn from(s: SplitLayer) -> Self
Converts to this type from the input type.
sourceimpl From<SwishLayer> for Layer
impl From<SwishLayer> for Layer
sourcefn from(s: SwishLayer) -> Self
fn from(s: SwishLayer) -> Self
Converts to this type from the input type.
sourceimpl From<ThresholdedReluLayer> for Layer
impl From<ThresholdedReluLayer> for Layer
sourcefn from(s: ThresholdedReluLayer) -> Self
fn from(s: ThresholdedReluLayer) -> Self
Converts to this type from the input type.
sourceimpl LayerTrait for Layer
impl LayerTrait for Layer
fn as_raw_mut_Layer(&mut self) -> *mut c_void
sourcefn set_blobs(&mut self, val: Vector<Mat>)
fn set_blobs(&mut self, val: Vector<Mat>)
List of learned parameters must be stored here to allow read them by using Net::getParam().
sourcefn set_name(&mut self, val: &str)
fn set_name(&mut self, val: &str)
Name of the layer instance, can be used for logging or other internal purposes.
sourcefn set_type(&mut self, val: &str)
fn set_type(&mut self, val: &str)
Type name which was used for creating layer by layer factory.
sourcefn set_preferable_target(&mut self, val: i32)
fn set_preferable_target(&mut self, val: i32)
prefer target for layer forwarding
sourcefn finalize(
&mut self,
inputs: &dyn ToInputArray,
outputs: &mut dyn ToOutputArray
) -> Result<()>
fn finalize(
&mut self,
inputs: &dyn ToInputArray,
outputs: &mut dyn ToOutputArray
) -> Result<()>
Computes and sets internal parameters according to inputs, outputs and blobs. Read more
sourcefn forward_mat(
&mut self,
input: &mut Vector<Mat>,
output: &mut Vector<Mat>,
internals: &mut Vector<Mat>
) -> Result<()>
fn forward_mat(
&mut self,
input: &mut Vector<Mat>,
output: &mut Vector<Mat>,
internals: &mut Vector<Mat>
) -> Result<()>
Use Layer::forward(InputArrayOfArrays, OutputArrayOfArrays, OutputArrayOfArrays) instead
Given the @p input blobs, computes the output @p blobs. Read more
sourcefn forward(
&mut self,
inputs: &dyn ToInputArray,
outputs: &mut dyn ToOutputArray,
internals: &mut dyn ToOutputArray
) -> Result<()>
fn forward(
&mut self,
inputs: &dyn ToInputArray,
outputs: &mut dyn ToOutputArray,
internals: &mut dyn ToOutputArray
) -> Result<()>
Given the @p input blobs, computes the output @p blobs. Read more
sourcefn try_quantize(
&mut self,
scales: &Vector<Vector<f32>>,
zeropoints: &Vector<Vector<i32>>,
params: &mut LayerParams
) -> Result<bool>
fn try_quantize(
&mut self,
scales: &Vector<Vector<f32>>,
zeropoints: &Vector<Vector<i32>>,
params: &mut LayerParams
) -> Result<bool>
Tries to quantize the given layer and compute the quantization parameters required for fixed point implementation. Read more
sourcefn forward_fallback(
&mut self,
inputs: &dyn ToInputArray,
outputs: &mut dyn ToOutputArray,
internals: &mut dyn ToOutputArray
) -> Result<()>
fn forward_fallback(
&mut self,
inputs: &dyn ToInputArray,
outputs: &mut dyn ToOutputArray,
internals: &mut dyn ToOutputArray
) -> Result<()>
Given the @p input blobs, computes the output @p blobs. Read more
sourcefn finalize_mat_to(
&mut self,
inputs: &Vector<Mat>,
outputs: &mut Vector<Mat>
) -> Result<()>
fn finalize_mat_to(
&mut self,
inputs: &Vector<Mat>,
outputs: &mut Vector<Mat>
) -> Result<()>
Use Layer::finalize(InputArrayOfArrays, OutputArrayOfArrays) instead
Computes and sets internal parameters according to inputs, outputs and blobs. Read more
sourcefn finalize_mat(&mut self, inputs: &Vector<Mat>) -> Result<Vector<Mat>>
fn finalize_mat(&mut self, inputs: &Vector<Mat>) -> Result<Vector<Mat>>
Use Layer::finalize(InputArrayOfArrays, OutputArrayOfArrays) instead
Computes and sets internal parameters according to inputs, outputs and blobs. Read more
sourcefn run(
&mut self,
inputs: &Vector<Mat>,
outputs: &mut Vector<Mat>,
internals: &mut Vector<Mat>
) -> Result<()>
fn run(
&mut self,
inputs: &Vector<Mat>,
outputs: &mut Vector<Mat>,
internals: &mut Vector<Mat>
) -> Result<()>
This method will be removed in the future release.
Allocates layer and computes output. Read more
sourcefn input_name_to_index(&mut self, input_name: &str) -> Result<i32>
fn input_name_to_index(&mut self, input_name: &str) -> Result<i32>
Returns index of input blob into the input array. Read more
sourcefn output_name_to_index(&mut self, output_name: &str) -> Result<i32>
fn output_name_to_index(&mut self, output_name: &str) -> Result<i32>
Returns index of output blob in output array. Read more
sourcefn support_backend(&mut self, backend_id: i32) -> Result<bool>
fn support_backend(&mut self, backend_id: i32) -> Result<bool>
Ask layer if it support specific backend for doing computations. Read more
sourcefn init_halide(
&mut self,
inputs: &Vector<Ptr<dyn BackendWrapper>>
) -> Result<Ptr<BackendNode>>
fn init_halide(
&mut self,
inputs: &Vector<Ptr<dyn BackendWrapper>>
) -> Result<Ptr<BackendNode>>
Returns Halide backend node. Read more
fn init_ngraph(
&mut self,
inputs: &Vector<Ptr<dyn BackendWrapper>>,
nodes: &Vector<Ptr<BackendNode>>
) -> Result<Ptr<BackendNode>>
fn init_vk_com(
&mut self,
inputs: &Vector<Ptr<dyn BackendWrapper>>
) -> Result<Ptr<BackendNode>>
fn init_webnn(
&mut self,
inputs: &Vector<Ptr<dyn BackendWrapper>>,
nodes: &Vector<Ptr<BackendNode>>
) -> Result<Ptr<BackendNode>>
sourceunsafe fn init_cuda(
&mut self,
context: *mut c_void,
inputs: &Vector<Ptr<dyn BackendWrapper>>,
outputs: &Vector<Ptr<dyn BackendWrapper>>
) -> Result<Ptr<BackendNode>>
unsafe fn init_cuda(
&mut self,
context: *mut c_void,
inputs: &Vector<Ptr<dyn BackendWrapper>>,
outputs: &Vector<Ptr<dyn BackendWrapper>>
) -> Result<Ptr<BackendNode>>
Returns a CUDA backend node Read more
sourceunsafe fn init_tim_vx(
&mut self,
tim_vx_info: *mut c_void,
inputs_wrapper: &Vector<Ptr<dyn BackendWrapper>>,
outputs_wrapper: &Vector<Ptr<dyn BackendWrapper>>,
is_last: bool
) -> Result<Ptr<BackendNode>>
unsafe fn init_tim_vx(
&mut self,
tim_vx_info: *mut c_void,
inputs_wrapper: &Vector<Ptr<dyn BackendWrapper>>,
outputs_wrapper: &Vector<Ptr<dyn BackendWrapper>>,
is_last: bool
) -> Result<Ptr<BackendNode>>
Returns a TimVX backend node Read more
sourcefn try_attach(&mut self, node: &Ptr<BackendNode>) -> Result<Ptr<BackendNode>>
fn try_attach(&mut self, node: &Ptr<BackendNode>) -> Result<Ptr<BackendNode>>
Implement layers fusing. Read more
sourcefn set_activation(&mut self, layer: &Ptr<ActivationLayer>) -> Result<bool>
fn set_activation(&mut self, layer: &Ptr<ActivationLayer>) -> Result<bool>
Tries to attach to the layer the subsequent activation layer, i.e. do the layer fusion in a partial case. Read more
sourcefn try_fuse(&mut self, top: &mut Ptr<Layer>) -> Result<bool>
fn try_fuse(&mut self, top: &mut Ptr<Layer>) -> Result<bool>
Try to fuse current layer with a next one Read more
sourcefn unset_attached(&mut self) -> Result<()>
fn unset_attached(&mut self) -> Result<()>
“Detaches” all the layers, attached to particular layer.
fn update_memory_shapes(&mut self, inputs: &Vector<MatShape>) -> Result<bool>
fn set_params_from(&mut self, params: &LayerParams) -> Result<()>
sourceimpl LayerTraitConst for Layer
impl LayerTraitConst for Layer
fn as_raw_Layer(&self) -> *const c_void
sourcefn blobs(&self) -> Vector<Mat>
fn blobs(&self) -> Vector<Mat>
List of learned parameters must be stored here to allow read them by using Net::getParam().
sourcefn name(&self) -> String
fn name(&self) -> String
Name of the layer instance, can be used for logging or other internal purposes.
sourcefn preferable_target(&self) -> i32
fn preferable_target(&self) -> i32
prefer target for layer forwarding
sourcefn apply_halide_scheduler(
&self,
node: &mut Ptr<BackendNode>,
inputs: &Vector<Mat>,
outputs: &Vector<Mat>,
target_id: i32
) -> Result<()>
fn apply_halide_scheduler(
&self,
node: &mut Ptr<BackendNode>,
inputs: &Vector<Mat>,
outputs: &Vector<Mat>,
target_id: i32
) -> Result<()>
Automatic Halide scheduling based on layer hyper-parameters. Read more
sourcefn get_scale_shift(&self, scale: &mut Mat, shift: &mut Mat) -> Result<()>
fn get_scale_shift(&self, scale: &mut Mat, shift: &mut Mat) -> Result<()>
Returns parameters of layers with channel-wise multiplication and addition. Read more
sourcefn get_scale_zeropoint(&self, scale: &mut f32, zeropoint: &mut i32) -> Result<()>
fn get_scale_zeropoint(&self, scale: &mut f32, zeropoint: &mut i32) -> Result<()>
Returns scale and zeropoint of layers Read more
fn get_memory_shapes(
&self,
inputs: &Vector<MatShape>,
required_outputs: i32,
outputs: &mut Vector<MatShape>,
internals: &mut Vector<MatShape>
) -> Result<bool>
fn get_flops(
&self,
inputs: &Vector<MatShape>,
outputs: &Vector<MatShape>
) -> Result<i64>
sourceimpl TryFrom<Layer> for AccumLayer
impl TryFrom<Layer> for AccumLayer
sourceimpl TryFrom<Layer> for ActivationLayer
impl TryFrom<Layer> for ActivationLayer
sourceimpl TryFrom<Layer> for BaseConvolutionLayer
impl TryFrom<Layer> for BaseConvolutionLayer
sourceimpl TryFrom<Layer> for BlankLayer
impl TryFrom<Layer> for BlankLayer
sourceimpl TryFrom<Layer> for CompareLayer
impl TryFrom<Layer> for CompareLayer
sourceimpl TryFrom<Layer> for ConcatLayer
impl TryFrom<Layer> for ConcatLayer
sourceimpl TryFrom<Layer> for ConstLayer
impl TryFrom<Layer> for ConstLayer
sourceimpl TryFrom<Layer> for CorrelationLayer
impl TryFrom<Layer> for CorrelationLayer
sourceimpl TryFrom<Layer> for CropAndResizeLayer
impl TryFrom<Layer> for CropAndResizeLayer
sourceimpl TryFrom<Layer> for CumSumLayer
impl TryFrom<Layer> for CumSumLayer
sourceimpl TryFrom<Layer> for DataAugmentationLayer
impl TryFrom<Layer> for DataAugmentationLayer
sourceimpl TryFrom<Layer> for DequantizeLayer
impl TryFrom<Layer> for DequantizeLayer
sourceimpl TryFrom<Layer> for DetectionOutputLayer
impl TryFrom<Layer> for DetectionOutputLayer
sourceimpl TryFrom<Layer> for EltwiseLayer
impl TryFrom<Layer> for EltwiseLayer
sourceimpl TryFrom<Layer> for EltwiseLayerInt8
impl TryFrom<Layer> for EltwiseLayerInt8
sourceimpl TryFrom<Layer> for FlattenLayer
impl TryFrom<Layer> for FlattenLayer
sourceimpl TryFrom<Layer> for FlowWarpLayer
impl TryFrom<Layer> for FlowWarpLayer
sourceimpl TryFrom<Layer> for InnerProductLayer
impl TryFrom<Layer> for InnerProductLayer
sourceimpl TryFrom<Layer> for InterpLayer
impl TryFrom<Layer> for InterpLayer
sourceimpl TryFrom<Layer> for MaxUnpoolLayer
impl TryFrom<Layer> for MaxUnpoolLayer
sourceimpl TryFrom<Layer> for NormalizeBBoxLayer
impl TryFrom<Layer> for NormalizeBBoxLayer
sourceimpl TryFrom<Layer> for PaddingLayer
impl TryFrom<Layer> for PaddingLayer
sourceimpl TryFrom<Layer> for PermuteLayer
impl TryFrom<Layer> for PermuteLayer
sourceimpl TryFrom<Layer> for PoolingLayer
impl TryFrom<Layer> for PoolingLayer
sourceimpl TryFrom<Layer> for PriorBoxLayer
impl TryFrom<Layer> for PriorBoxLayer
sourceimpl TryFrom<Layer> for ProposalLayer
impl TryFrom<Layer> for ProposalLayer
sourceimpl TryFrom<Layer> for QuantizeLayer
impl TryFrom<Layer> for QuantizeLayer
sourceimpl TryFrom<Layer> for ReduceLayer
impl TryFrom<Layer> for ReduceLayer
sourceimpl TryFrom<Layer> for RegionLayer
impl TryFrom<Layer> for RegionLayer
sourceimpl TryFrom<Layer> for ReorgLayer
impl TryFrom<Layer> for ReorgLayer
sourceimpl TryFrom<Layer> for RequantizeLayer
impl TryFrom<Layer> for RequantizeLayer
sourceimpl TryFrom<Layer> for ReshapeLayer
impl TryFrom<Layer> for ReshapeLayer
sourceimpl TryFrom<Layer> for ResizeLayer
impl TryFrom<Layer> for ResizeLayer
sourceimpl TryFrom<Layer> for ScaleLayer
impl TryFrom<Layer> for ScaleLayer
sourceimpl TryFrom<Layer> for ShiftLayer
impl TryFrom<Layer> for ShiftLayer
sourceimpl TryFrom<Layer> for ShiftLayerInt8
impl TryFrom<Layer> for ShiftLayerInt8
sourceimpl TryFrom<Layer> for ShuffleChannelLayer
impl TryFrom<Layer> for ShuffleChannelLayer
sourceimpl TryFrom<Layer> for SliceLayer
impl TryFrom<Layer> for SliceLayer
sourceimpl TryFrom<Layer> for SoftmaxLayer
impl TryFrom<Layer> for SoftmaxLayer
sourceimpl TryFrom<Layer> for SplitLayer
impl TryFrom<Layer> for SplitLayer
impl Send for Layer
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more