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

#include <ConstantOp.h>

Collaboration diagram for mir::ops::ConstantOp:

Public Member Functions

 ConstantOp (const TensorVariant &value)
 
const TensorVariantgetValue () const
 
OperationcopyWithInputs (const std::vector< mir::Operation::Output * > &input) override
 
- 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)
 
virtual OperationcopyWithInputs (const std::vector< Output * > &inputs)=0
 

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 28 of file ConstantOp.h.

Constructor & Destructor Documentation

◆ ConstantOp()

mir::ops::ConstantOp::ConstantOp ( const TensorVariant value)
inlineexplicit

Definition at line 31 of file ConstantOp.h.

31 : Operation(Type::constant, {}), _value(value)
32 {
33 setOutputType(0, _value.getType());
34 }
void setOutputType(std::size_t index, const TensorType &type)
Definition Operation.h:172
const TensorType & getType() const

Member Function Documentation

◆ copyWithInputs()

Operation * mir::ops::ConstantOp::copyWithInputs ( const std::vector< mir::Operation::Output * > &  input)
inlineoverride

Definition at line 38 of file ConstantOp.h.

39 {
40 assert(false && "Copying constants is not allowed!");
41 (void)input;
42 return nullptr;
43 }

◆ getValue()

const TensorVariant & mir::ops::ConstantOp::getValue ( ) const
inline

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