MatchLib
Functions

One-hot to binary convertor. More...

Functions

template<unsigned OneHotLen, unsigned BinLen>
void one_hot_to_bin (const NVUINTW(OneHotLen)&one_hot_in, NVUINTW(BinLen)&bin_out)
 One hot to binary conversion. More...
 

Detailed Description

One-hot to binary convertor.

Function Documentation

template<unsigned OneHotLen, unsigned BinLen>
void one_hot_to_bin ( const NVUINTW(OneHotLen)&  one_hot_in,
NVUINTW(BinLen)&  bin_out 
)

One hot to binary conversion.

Template Parameters
OneHotLenWidth of one-hot representation
BinLenWidth of binary output
Parameters
[in]one_hot_inOne hot input
[out]bin_outBinary output
A Simple Example
1 #include <one_hot_to_bin.h>
2 
3 ...
4 NVUINT4 input = 4;
5 NVUINT2 output;
6 ...
7 one_hot_to_bin<4, 2>(input, output);
8 ...

Definition at line 47 of file one_hot_to_bin.h.