#include <networkscratch.h>
Definition at line 51 of file networkscratch.h.
◆ IO() [1/2]
Definition at line 54 of file networkscratch.h.
55 : int_mode_(scratch->int_mode_ && src.int_mode()),
56 scratch_space_(scratch) {
57 network_io_ = int_mode_ ? scratch_space_->int_stack_.Borrow()
58 : scratch_space_->float_stack_.Borrow();
59 }
◆ IO() [2/2]
tesseract::NetworkScratch::IO::IO |
( |
| ) |
|
|
inline |
Definition at line 62 of file networkscratch.h.
62: int_mode_(false), network_io_(nullptr), scratch_space_(nullptr) {}
◆ ~IO()
tesseract::NetworkScratch::IO::~IO |
( |
| ) |
|
|
inline |
Definition at line 64 of file networkscratch.h.
64 {
65 if (scratch_space_ == nullptr) {
67 } else if (int_mode_) {
68 scratch_space_->int_stack_.Return(network_io_);
69 } else {
70 scratch_space_->float_stack_.Return(network_io_);
71 }
72 }
◆ operator NetworkIO *()
tesseract::NetworkScratch::IO::operator NetworkIO * |
( |
| ) |
|
|
inline |
◆ operator*()
NetworkIO & tesseract::NetworkScratch::IO::operator* |
( |
| ) |
|
|
inline |
◆ operator->()
NetworkIO * tesseract::NetworkScratch::IO::operator-> |
( |
| ) |
|
|
inline |
◆ Resize()
Definition at line 76 of file networkscratch.h.
77 {
78 if (scratch_space_ == nullptr) {
79 int_mode_ = scratch->int_mode_ && src.int_mode();
80 scratch_space_ = scratch;
81 network_io_ = int_mode_ ? scratch_space_->int_stack_.Borrow()
82 : scratch_space_->float_stack_.Borrow();
83 }
84 network_io_->
Resize(src, num_features);
85 }
void Resize(const NetworkIO &src, int num_features)
◆ Resize2d()
void tesseract::NetworkScratch::IO::Resize2d |
( |
bool |
int_mode, |
|
|
int |
width, |
|
|
int |
num_features, |
|
|
NetworkScratch * |
scratch |
|
) |
| |
|
inline |
Definition at line 87 of file networkscratch.h.
88 {
89 if (scratch_space_ == nullptr) {
90 int_mode_ = scratch->int_mode_ && int_mode;
91 scratch_space_ = scratch;
92 network_io_ = int_mode_ ? scratch_space_->int_stack_.Borrow()
93 : scratch_space_->float_stack_.Borrow();
94 }
95 network_io_->
Resize2d(int_mode, width, num_features);
96 }
void Resize2d(bool int_mode, int width, int num_features)
◆ ResizeFloat()
void tesseract::NetworkScratch::IO::ResizeFloat |
( |
const NetworkIO & |
src, |
|
|
int |
num_features, |
|
|
NetworkScratch * |
scratch |
|
) |
| |
|
inline |
Definition at line 99 of file networkscratch.h.
100 {
101 if (scratch_space_ == nullptr) {
102 int_mode_ = false;
103 scratch_space_ = scratch;
104 network_io_ = scratch_space_->float_stack_.Borrow();
105 }
107 }
void ResizeFloat(const NetworkIO &src, int num_features)
The documentation for this class was generated from the following file: