pub struct MultiplyLayerParams {
pub alpha: f32,
}Expand description
A layer that performs elementwise multiplication. This layer has limited broadcasting support. For general broadcasting see MultiplyBroadcastableLayer.
.. code::
y = MultiplyLayer(x1,x2,...)Requires 1 or more than 1 input and produces 1 output.
Input In general, there are no rank constraints. However, only certain set of shapes are broadcastable. For example: [B, 1, 1, 1], [B, C, 1, 1], [B, 1, H, W], [B, C, H, W] Output A blob with shape equal to the first input blob.
If only one input is provided, scalar multiplication is performed:
.. math:: y = \alpha x
Fields§
§alpha: f32Scalar to be multiplied with the input. Only used if there is a single input.
Trait Implementations§
Source§impl Clone for MultiplyLayerParams
impl Clone for MultiplyLayerParams
Source§fn clone(&self) -> MultiplyLayerParams
fn clone(&self) -> MultiplyLayerParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MultiplyLayerParams
impl Debug for MultiplyLayerParams
Source§impl Default for MultiplyLayerParams
impl Default for MultiplyLayerParams
Source§impl Message for MultiplyLayerParams
impl Message for MultiplyLayerParams
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for MultiplyLayerParams
impl PartialEq for MultiplyLayerParams
Source§fn eq(&self, other: &MultiplyLayerParams) -> bool
fn eq(&self, other: &MultiplyLayerParams) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for MultiplyLayerParams
impl StructuralPartialEq for MultiplyLayerParams
Auto Trait Implementations§
impl Freeze for MultiplyLayerParams
impl RefUnwindSafe for MultiplyLayerParams
impl Send for MultiplyLayerParams
impl Sync for MultiplyLayerParams
impl Unpin for MultiplyLayerParams
impl UnsafeUnpin for MultiplyLayerParams
impl UnwindSafe for MultiplyLayerParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more