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

◆ one_hot_to_bin()

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
#include <one_hot_to_bin.h>
...
NVUINT4 input = 4;
NVUINT2 output;
...
one_hot_to_bin<4, 2>(input, output);
...

Definition at line 47 of file one_hot_to_bin.h.