ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::tf::BroadcastFunctor Class Referencefinal

#include <BroadcastHelper.h>

Public Member Functions

 BroadcastFunctor (const loco::TensorShape &shape)
 
loco::Nodebuild (loco::Node *in_node, const loco::TensorShape &in_shape) const
 
loco::Nodeoperator() (loco::Node *in_node, const loco::TensorShape &in_shape) const
 
loco::Nodebuild (loco::Node *node) const
 
loco::Nodeoperator() (loco::Node *node) const
 

Detailed Description

Definition at line 32 of file BroadcastHelper.h.

Constructor & Destructor Documentation

◆ BroadcastFunctor()

moco::tf::BroadcastFunctor::BroadcastFunctor ( const loco::TensorShape shape)
inline

Definition at line 35 of file BroadcastHelper.h.

35 : _shape{shape}
36 {
37 // DO NOTHING
38 }

Member Function Documentation

◆ build() [1/2]

loco::Node * moco::tf::BroadcastFunctor::build ( loco::Node in_node,
const loco::TensorShape in_shape 
) const

Definition at line 210 of file BroadcastHelper.cpp.

211{
212 // clang-format off
213 return glue(node, shape)
214 | expand_rank_to(_shape.rank())
215 | expand_dims_as(_shape)
216 | [] (const NodeWithTensorShape &in) { return in.node(); };
217 // clang-format on
218}
uint32_t rank(void) const
Definition TensorShape.h:35

References loco::TensorShape::rank().

Referenced by build(), operator()(), and operator()().

◆ build() [2/2]

loco::Node * moco::tf::BroadcastFunctor::build ( loco::Node node) const

Definition at line 220 of file BroadcastHelper.cpp.

221{
222 return build(node, loco::shape_get(node).as<loco::TensorShape>());
223}
loco::Node * build(loco::Node *in_node, const loco::TensorShape &in_shape) const
NodeShape shape_get(const Node *node)

References build(), and loco::shape_get().

◆ operator()() [1/2]

loco::Node * moco::tf::BroadcastFunctor::operator() ( loco::Node in_node,
const loco::TensorShape in_shape 
) const
inline

Definition at line 43 of file BroadcastHelper.h.

44 {
45 return build(in_node, in_shape);
46 }

References build().

◆ operator()() [2/2]

loco::Node * moco::tf::BroadcastFunctor::operator() ( loco::Node node) const
inline

Definition at line 53 of file BroadcastHelper.h.

53{ return build(node); }

References build().


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