21.02
|
Print Layer. More...
#include <Layers.h>
Public Member Functions | |
PrintLayer (std::ostream &stream, const IOFormatInfo &format_info=IOFormatInfo(), const std::function< ITensor *(ITensor *)> transform=nullptr) | |
Construct a print layer. More... | |
NodeID | create_layer (IStream &s) override |
Create layer and add to the given stream. More... | |
Public Member Functions inherited from ILayer | |
virtual | ~ILayer ()=default |
Default destructor. More... | |
ILayer & | set_name (std::string name) |
Sets the name of the layer. More... | |
const std::string & | name () const |
Layer name accessor. More... | |
|
inline |
Construct a print layer.
Example usage to locally dequantize and print a tensor:
Tensor *output = new Tensor(); const auto transform = [output](ITensor *input) { output->allocator()->init(*input->info()); output->info()->set_data_type(DataType::F32); output->allocator()->allocate();
Window win; win.use_tensor_dimensions(input->info()->tensor_shape()); Iterator in(input, win); Iterator out(output, win); execute_window_loop(win, [&](const Coordinates &) { *(reinterpret_cast<float *>(out.ptr())) = dequantize_qasymm8(*in.ptr(), input->info()->quantization_info().uniform()); }, in, out);
return output; };
graph << InputLayer(input_descriptor.set_quantization_info(in_quant_info), get_input_accessor(common_params, nullptr, false)) << ... << \ CNN Layers << ... << PrintLayer(std::cout, IOFormatInfo(), transform) << ... << OutputLayer(get_output_accessor(common_params, 5));
[in] | stream | Output stream. |
[in] | format_info | (Optional) Format info. |
[in] | transform | (Optional) Input transform function. |
Create layer and add to the given stream.
[in] | s | Stream to add layer to. |
Implements ILayer.
Definition at line 1072 of file Layers.h.
References GraphBuilder::add_print_node(), IStream::graph(), IStream::hints(), arm_compute::test::validation::input, ILayer::name(), IStream::tail_node(), and StreamHints::target_hint.