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

#include <SliceOp.h>

Collaboration diagram for mir::ops::SliceOp:

Public Member Functions

 SliceOp (Output *arg, const Shape &starts, const Shape &sizes)
 
OperationcopyWithInputs (const std::vector< Output * > &inputs) override
 
const ShapegetStarts ()
 
const ShapegetSizes ()
 
- 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 27 of file SliceOp.h.

Constructor & Destructor Documentation

◆ SliceOp()

mir::ops::SliceOp::SliceOp ( Output arg,
const Shape starts,
const Shape sizes 
)
inline

Definition at line 30 of file SliceOp.h.

31 : Operation(Type::slice, {arg}), _starts(starts), _sizes(sizes)
32 {
33 inferOutputTypes();
34 }

Member Function Documentation

◆ copyWithInputs()

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

Implements mir::Operation.

Definition at line 36 of file SliceOp.h.

37 {
38 return new SliceOp(inputs[0], _starts, _sizes);
39 }
SliceOp(Output *arg, const Shape &starts, const Shape &sizes)
Definition SliceOp.h:30

◆ getSizes()

const Shape & mir::ops::SliceOp::getSizes ( )
inline

Definition at line 43 of file SliceOp.h.

43{ return _sizes; }

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

◆ getStarts()

const Shape & mir::ops::SliceOp::getStarts ( )
inline

Definition at line 41 of file SliceOp.h.

41{ return _starts; }

Referenced by mir_interpreter::MIRInterpreter::visit(), nnc::Serializer::visit(), and mir::DotNodeBuilder::visit().


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