ONE - On-device Neural Engine
Loading...
Searching...
No Matches
ShowAction Struct Referencefinal
Collaboration diagram for ShowAction:

Public Member Functions

void run (nnkit::TensorContext &ctx) override
 
- Public Member Functions inherited from nnkit::Action
virtual ~Action ()=default
 

Detailed Description

Definition at line 39 of file Show.cpp.

Member Function Documentation

◆ run()

void ShowAction::run ( nnkit::TensorContext ctx)
overridevirtual

Implements nnkit::Action.

Definition at line 44 of file Show.cpp.

45{
46 std::cout << "count: " << ctx.size() << std::endl;
47 for (uint32_t n = 0; n < ctx.size(); ++n)
48 {
49 std::cout << " tensor(" << n << ") : " << ctx.name(n) << std::endl;
50
53
54 ctx.getConstFloatTensor(n, [](const TensorContext &ctx, uint32_t n, const Reader<float> &t) {
55 for (IndexEnumerator e{ctx.shape(n)}; e.valid(); e.advance())
56 {
57 const auto &index = e.current();
58
59 std::cout << " " << index << ": " << t.at(index) << std::endl;
60 }
61 });
62 }
63}
loco::GraphInputIndex index(const TFPlaceholder *node)
Definition TFNode.cpp:54
virtual std::string name(uint32_t n) const =0
virtual void getConstFloatTensor(uint32_t n, const TypedReader< float > &cb) const
virtual uint32_t size(void) const =0

References nnkit::TensorContext::getConstFloatTensor(), nnkit::TensorContext::name(), nnkit::TensorContext::size(), and nncc::core::ADT::tensor::IndexEnumerator::valid().

Referenced by package.infer.session::inference().


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