ONE - On-device Neural Engine
Loading...
Searching...
No Matches
souschef::ConstantUint4DataChef Class Referencefinal

#include <Constant.h>

Collaboration diagram for souschef::ConstantUint4DataChef:

Public Member Functions

 ConstantUint4DataChef (const uint8_t &value)
 
std::vector< uint8_t > generate (int32_t count) const override
 Generate a sequence of 'count' elements as a byte sequence.
 
- Public Member Functions inherited from souschef::DataChef
virtual ~DataChef ()=default
 

Detailed Description

Definition at line 113 of file Constant.h.

Constructor & Destructor Documentation

◆ ConstantUint4DataChef()

souschef::ConstantUint4DataChef::ConstantUint4DataChef ( const uint8_t &  value)
inline

Definition at line 116 of file Constant.h.

116 : _value{value}
117 {
118 // DO NOTHING
119 }

Member Function Documentation

◆ generate()

std::vector< uint8_t > souschef::ConstantUint4DataChef::generate ( int32_t  count) const
inlineoverridevirtual

Generate a sequence of 'count' elements as a byte sequence.

Let D be the return value of generate(N). Then, D.size() == N * sizeof(T) where T is the element type.

Implements souschef::DataChef.

Definition at line 122 of file Constant.h.

123 {
124 std::vector<uint8_t> res;
125
126 if (15 < _value)
127 throw std::runtime_error("Constant value out of range.");
128
129 for (uint32_t n = 0; n < count; ++n)
130 {
131 res.emplace_back(_value);
132 }
133
134 return res;
135 }

The documentation for this class was generated from the following file: