ONE - On-device Neural Engine
Loading...
Searching...
No Matches
loco::TensorConstantPad Class Referencefinal

Pads a tensor with constant value. More...

#include <Nodes.h>

Collaboration diagram for loco::TensorConstantPad:

Public Member Functions

Nodeinput (void) const
 
void input (Node *node)
 
Nodeconstant (void) const
 
void constant (Node *node)
 
const PaddingNDpadding (void) const
 
PaddingNDpadding (void)
 
- Public Member Functions inherited from loco::CanonicalNodeDef< CanonicalOpcode::TensorConstantPad, FixedArity< 2 >::Mixin >
virtual ~CanonicalNodeDef ()=default
 
uint32_t opnum (void) const final
 
CanonicalOpcode opcode (void) const final
 
- Public Member Functions inherited from loco::CanonicalNode
virtual ~CanonicalNode ()=default
 
const Dialectdialect (void) const final
 Return "Dialect" identifier that this node belongs to.
 
template<typename T >
accept (CanonicalNodeVisitorBase< T > *) const
 
template<typename T >
accept (CanonicalNodeMutableVisitorBase< T > *)
 
- Public Member Functions inherited from loco::Node
 Node ()=default
 
 Node (const Node &)=delete
 
 Node (Node &&)=delete
 
virtual ~Node ()
 
Graphgraph (void)
 
const Graphgraph (void) const
 
virtual uint32_t arity (void) const =0
 Return the number of arguments.
 
virtual Nodearg (uint32_t N) const =0
 Access N-th argument node.
 
virtual void drop (void)=0
 Drop all the reference of arguments.
 
- Public Member Functions inherited from loco::AnnotatedItem< NodeAnnotation >
 AnnotatedItem ()=default
 
virtual ~AnnotatedItem ()=default
 
const T * annot (void) const
 Retrieve a stored annotation of type T.
 
void annot (std::unique_ptr< T > &&p)
 Attach or remove a new annotation of type T.
 

Detailed Description

Pads a tensor with constant value.

Pads a input tensor according to the padding with constant value.

The dimension of each axis n of the output is output.dim(n) = padding.front(n) + input.dim(n) + padding.back(n)

For example, input tensor of shape [1, 2] with

padding.front(0) = 1; padding.back(0) = 2;

padding.front(1) = 3; padding.back(1) = 4;

will be a output tensor of shape [padding.front(0) + 1 + padding.back(0), padding.front(1) + 2 + padding.back(1)] = [4,9].

Definition at line 850 of file Nodes.h.

Member Function Documentation

◆ constant() [1/2]

void loco::TensorConstantPad::constant ( Node node)
inline

Definition at line 858 of file Nodes.h.

858{ at(1)->node(node); }

◆ constant() [2/2]

Node * loco::TensorConstantPad::constant ( void  ) const
inline

Definition at line 857 of file Nodes.h.

857{ return at(1)->node(); }

◆ input() [1/2]

void loco::TensorConstantPad::input ( Node node)
inline

Definition at line 855 of file Nodes.h.

855{ at(0)->node(node); }

◆ input() [2/2]

Node * loco::TensorConstantPad::input ( void  ) const
inline

Definition at line 854 of file Nodes.h.

854{ return at(0)->node(); }

◆ padding() [1/2]

PaddingND * loco::TensorConstantPad::padding ( void  )
inline

Definition at line 862 of file Nodes.h.

862{ return &_padding; }

◆ padding() [2/2]

const PaddingND * loco::TensorConstantPad::padding ( void  ) const
inline

Definition at line 861 of file Nodes.h.

861{ return &_padding; }

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