ONE - On-device Neural Engine
Loading...
Searching...
No Matches
mir::ops::Conv2DOp Class Reference

#include <Conv2DOp.h>

Collaboration diagram for mir::ops::Conv2DOp:

Public Member Functions

 Conv2DOp (Output *input, Output *kernel, const Conv2DOpAttributes &attributes)
 
 Conv2DOp (Output *input, Output *kernel, Output *bias, const Conv2DOpAttributes &attributes)
 
OperationcopyWithInputs (const std::vector< Output * > &inputs) override
 
const std::vector< std::int32_t > & getStrides () const
 
const std::vector< std::int32_t > & getPaddingBefore () const
 
const std::vector< std::int32_t > & getPaddingAfter () const
 
std::int32_t getNumGroups () const
 
DataFormat getDataFormat () const
 
const Conv2DOpAttributesgetAttributes () const
 
- Public Member Functions inherited from mir::Operation
virtual ~Operation ()=default
 
Type getType () const
 
std::size_t getId () const
 
void setId (std::size_t id)
 
std::size_t getNumInputs () const
 
std::size_t getNumOutputs () const
 
std::deque< Output * > & getInputs ()
 
const std::deque< Output * > & getInputs () const
 
std::deque< Output > & getOutputs ()
 
const std::deque< Output > & getOutputs () const
 
OutputgetInput (std::size_t index)
 
const OutputgetInput (std::size_t index) const
 
OutputgetOutput (std::size_t index)
 
const OutputgetOutput (std::size_t index) const
 
const ShapegetInputShape (std::size_t index) const
 
const ShapegetOutputShape (std::size_t index) const
 
void accept (IVisitor *v)
 

Additional Inherited Members

- Public Types inherited from mir::Operation
enum class  Type { HANDLE_OP }
 
- Protected Member Functions inherited from mir::Operation
 Operation (Type type, const std::vector< Output * > &inputs, std::size_t num_outputs=1)
 
void setOutputType (std::size_t index, const TensorType &type)
 

Detailed Description

Definition at line 29 of file Conv2DOp.h.

Constructor & Destructor Documentation

◆ Conv2DOp() [1/2]

mir::ops::Conv2DOp::Conv2DOp ( Output input,
Output kernel,
const Conv2DOpAttributes attributes 
)
inline

Definition at line 32 of file Conv2DOp.h.

33 : Operation(Type::conv2D, {input, kernel}), _attributes(attributes)
34 {
35 inferOutputTypes();
36 }

◆ Conv2DOp() [2/2]

mir::ops::Conv2DOp::Conv2DOp ( Output input,
Output kernel,
Output bias,
const Conv2DOpAttributes attributes 
)
inline

Definition at line 38 of file Conv2DOp.h.

39 : Operation(Type::conv2D, {input, kernel, bias}), _attributes(attributes)
40 {
41 inferOutputTypes();
42 }

Member Function Documentation

◆ copyWithInputs()

Operation * mir::ops::Conv2DOp::copyWithInputs ( const std::vector< Output * > &  inputs)
inlineoverridevirtual

Implements mir::Operation.

Definition at line 44 of file Conv2DOp.h.

45 {
46 if (inputs.size() == 2)
47 return new Conv2DOp(inputs[0], inputs[1], _attributes);
48 else
49 return new Conv2DOp(inputs[0], inputs[1], inputs[2], _attributes);
50 };
Conv2DOp(Output *input, Output *kernel, const Conv2DOpAttributes &attributes)
Definition Conv2DOp.h:32

◆ getAttributes()

const Conv2DOpAttributes & mir::ops::Conv2DOp::getAttributes ( ) const
inline

Definition at line 62 of file Conv2DOp.h.

62{ return _attributes; }

Referenced by mir_interpreter::MIRInterpreter::visit().

◆ getDataFormat()

DataFormat mir::ops::Conv2DOp::getDataFormat ( ) const
inline

Definition at line 60 of file Conv2DOp.h.

60{ return _attributes.data_format; }

References mir::Conv2DOpAttributes::data_format.

Referenced by mir2loco::Transformer::visit(), and mir::DotNodeBuilder::visit().

◆ getNumGroups()

std::int32_t mir::ops::Conv2DOp::getNumGroups ( ) const
inline

◆ getPaddingAfter()

const std::vector< std::int32_t > & mir::ops::Conv2DOp::getPaddingAfter ( ) const
inline

Definition at line 56 of file Conv2DOp.h.

56{ return _attributes.padding_after; }
std::vector< std::int32_t > padding_after
Definition Attributes.h:33

References mir::Conv2DOpAttributes::padding_after.

Referenced by mir2loco::Transformer::visit(), and mir::DotNodeBuilder::visit().

◆ getPaddingBefore()

const std::vector< std::int32_t > & mir::ops::Conv2DOp::getPaddingBefore ( ) const
inline

Definition at line 54 of file Conv2DOp.h.

54{ return _attributes.padding_before; }
std::vector< std::int32_t > padding_before
Definition Attributes.h:32

References mir::Conv2DOpAttributes::padding_before.

Referenced by mir2loco::Transformer::visit(), and mir::DotNodeBuilder::visit().

◆ getStrides()

const std::vector< std::int32_t > & mir::ops::Conv2DOp::getStrides ( ) const
inline

Definition at line 52 of file Conv2DOp.h.

52{ return _attributes.strides; }
std::vector< std::int32_t > strides
Definition Attributes.h:31

References mir::Conv2DOpAttributes::strides.

Referenced by mir2loco::Transformer::visit(), nnc::Serializer::visit(), and mir::DotNodeBuilder::visit().


The documentation for this class was generated from the following files: