a derived class should override this method, in order to implement the actual processing
| 196 | |
| 197 | // a derived class should override this method, in order to implement the actual processing |
| 198 | eTickResult cRnnProcessor::myTick(long long t) |
| 199 | { |
| 200 | if (!writer_->checkWrite(1)) |
| 201 | return TICK_DEST_NO_SPACE; |
| 202 | |
| 203 | cVector * frame = reader_->getNextFrame(); |
| 204 | if (frame == NULL) return TICK_SOURCE_NOT_AVAIL; |
| 205 | |
| 206 | // pass current vector to net |
| 207 | long i, N=0; |
| 208 | for (i=0; i<MIN(frame->N,net.inputSize); i++) { in[i] = (FLOAT_NN)(frame->data[i]); } |
| 209 | rnn->forward(in, MIN(frame->N,net.inputSize)); |
| 210 | |
| 211 | // get output |
| 212 | const FLOAT_NN *outp = rnn->getOutput(&N); |
| 213 | |
| 214 | //copy to *dst; |
| 215 | for (i=0; i<MIN(frameO->N,N); i++) { |
| 216 | frameO->data[i] = (FLOAT_DMEM)outp[i]; |
| 217 | } |
| 218 | |
| 219 | writer_->setNextFrame(frameO); |
| 220 | |
| 221 | return TICK_SUCCESS; |
| 222 | } |
| 223 | |
| 224 | cRnnProcessor::~cRnnProcessor() |
| 225 | { |
nothing calls this directly
no test coverage detected