Skip to content

Commit

Permalink
[luci-interpreter] Support UINT4 (Samsung#12796)
Browse files Browse the repository at this point in the history
This will revise to support UINT4 data type.

ONE-DCO-1.0-Signed-off-by: SaeHie Park <[email protected]>
  • Loading branch information
seanshpark authored Mar 20, 2024
1 parent dbd4aa3 commit 05c6a6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/luci-interpreter/src/kernels/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ void calculateActivationRangeQuantized(Activation activation, const Tensor *outp
int32_t qmax{};
switch (output->element_type())
{
case DataType::U4:
qmin = 0;
qmax = 15;
break;
case DataType::U8:
qmin = 0;
qmax = std::numeric_limits<uint8_t>::max();
Expand Down
2 changes: 2 additions & 0 deletions compiler/luci-interpreter/src/loader/GraphLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const void *getNodeData(const luci::CircleConst *node, size_t *data_size)
{
switch (node->dtype())
{
case DataType::U4:
return getNodeDataImpl<DataType::U4>(node, data_size);
case DataType::U8:
return getNodeDataImpl<DataType::U8>(node, data_size);
case DataType::FLOAT32:
Expand Down

0 comments on commit 05c6a6e

Please sign in to comment.