ONE - On-device Neural Engine
|
Pass to sparsify tensor. More...
#include <SparsifyTensorPass.h>
Public Member Functions | |
SparsifyTensorPass (const std::string &tensor_name, const std::vector< int32_t > &traversal_order, const std::vector< DimensionType > &format, const std::vector< int32_t > &block_size, const std::vector< int32_t > &block_map) | |
const char * | name (void) const final |
bool | run (loco::Graph *g) final |
Run the pass. | |
template<loco::DataType DT> | |
void | sparsify_tensor (luci::CircleConst *cop) |
Public Member Functions inherited from logo::Pass | |
virtual | ~Pass ()=default |
Pass to sparsify tensor.
Definition at line 32 of file SparsifyTensorPass.h.
|
inline |
Definition at line 35 of file SparsifyTensorPass.h.
|
inlinefinalvirtual |
Reimplemented from logo::Pass.
Definition at line 45 of file SparsifyTensorPass.h.
|
finalvirtual |
Run the pass.
Implements logo::Pass.
Definition at line 87 of file SparsifyTensorPass.cpp.
References loco::active_nodes(), loco::output_nodes(), luci::SparsifyTensorPass::sparsify_tensor< loco::DataType::FLOAT32 >(), luci::SparsifyTensorPass::sparsify_tensor< loco::DataType::S32 >(), and luci::SparsifyTensorPass::sparsify_tensor< loco::DataType::S8 >().
Referenced by package.infer.session::inference(), and luci::CircleOptimizer::sparsify().
template void luci::SparsifyTensorPass::sparsify_tensor< loco::DataType::FLOAT32 > | ( | luci::CircleConst * | cop | ) |
Definition at line 26 of file SparsifyTensorPass.cpp.
References luci::CircleConst::at(), luci::DENSE, luci::Sparsifier< T >::DenseToSparse(), luci::Sparsifier< T >::GetData(), luci::Sparsifier< T >::GetDimMetadata(), luci::CircleConst::size(), luci::SPARSE_CSR, luci::CircleNode::sparsityparam(), and luci::U16.