ONE - On-device Neural Engine
|
Functions | |
void | Abs (const mir::TensorVariant &arg, mir::TensorVariant &result) |
void | Add (const TensorVariant &lhs, const TensorVariant &rhs, TensorVariant &res) |
void | AvgPool2D (const mir::ops::AvgPool2DOp &op, const mir::TensorVariant &input, mir::TensorVariant &output) |
void | CappedReLU (const mir::TensorVariant &arg, float cap, mir::TensorVariant &result) |
Index | shift (const Index &in_index, const Shape &shift_from) |
template<template< typename > class F, typename... Args> | |
void | dispatch (mir::DataType dt, Args &&...args) |
template<typename T > | |
void | erase (mir::TensorVariant &tv) |
void | Concat (const std::vector< std::reference_wrapper< const mir::TensorVariant > > &inputs, int axis, mir::TensorVariant &output) |
void | Conv2D (const mir::TensorVariant &input, const mir::TensorVariant &kernel, const mir::Conv2DOpAttributes &attributes, mir::TensorVariant &result, const mir::TensorVariant *fused_bias) |
void | DeConv2D (const mir::TensorVariant &input, const mir::TensorVariant &kernel, const mir::Deconv2DOpAttributes &attributes, mir::TensorVariant &output) |
Transposed convolution (or Deconvolution) | |
void | DepthwiseConv2D (const mir::ops::DepthwiseConv2DOp &op, const mir::TensorVariant &input, const mir::TensorVariant &kernel, mir::TensorVariant &output, const mir::TensorVariant *bias) |
void | Div (const TensorVariant &lhs, const TensorVariant &rhs, TensorVariant &res) |
void | ELU (const mir::TensorVariant &arg, float alpha, mir::TensorVariant &result) |
void | Equal (const TensorVariant &lhs, const TensorVariant &rhs, TensorVariant &res) |
template<typename F > | |
void | Fill (mir::TensorVariant &t, F f) |
void | FullyConnected (const mir::TensorVariant &input, const mir::TensorVariant &weights, const mir::ops::FullyConnectedOp &op, mir::TensorVariant &res, const mir::TensorVariant *bias) |
void | Gather (const TensorVariant &data, const TensorVariant &indices, const ops::GatherOp &op, TensorVariant &res) |
void | Greater (const TensorVariant &lhs, const TensorVariant &rhs, TensorVariant &res) |
void | HardSwish (const mir::TensorVariant &input, mir::TensorVariant &result) |
void | LeakyReLU (const mir::TensorVariant &arg, float alpha, mir::TensorVariant &result) |
void | Less (const TensorVariant &lhs, const TensorVariant &rhs, TensorVariant &res) |
void | Max (const TensorVariant &lhs, const TensorVariant &rhs, TensorVariant &res) |
void | MaxPool2D (const mir::TensorVariant &input, const mir::ops::MaxPool2DOp &op, mir::TensorVariant &result) |
void | Mul (const TensorVariant &lhs, const TensorVariant &rhs, TensorVariant &res) |
void | Pad (const mir::TensorVariant &input, const mir::ops::PadOp &op, mir::TensorVariant &result) |
Implements PadOp for interpreter backend. | |
void | Dequantize (const TensorVariant &input, TensorVariant &output) |
void | Quantize (const TensorVariant &input, TensorVariant &output) |
void | QuantizeMultiplier (double double_multiplier, int32_t *quantized_multiplier, int *shift) |
void | QuantizeMultiplierSmallerThanOneExp (double double_multiplier, int32_t *quantized_multiplier, int *left_shift) |
int32_t | MaskIfNonZero (int32_t a) |
int32_t | MaskIfZero (int32_t a) |
int32_t | MaskIfLessThan (int32_t a, int32_t b) |
int32_t | MaskIfGreaterThan (int32_t a, int32_t b) |
int32_t | RoundingDivideByPOT (int32_t x, int exponent) |
std::int32_t | SaturatingRoundingDoublingHighMul (std::int32_t a, std::int32_t b) |
int32_t | MultiplyByQuantizedMultiplier (int32_t x, int32_t quantized_multiplier, int shift) |
int32_t | MultiplyByQuantizedMultiplierSmallerThanOneExp (int32_t x, int32_t quantized_multiplier, int left_shift) |
void | ReduceMean (const mir::TensorVariant &input, const mir::ops::ReduceMeanOp &op, mir::TensorVariant &output) |
void | ReLU (const mir::TensorVariant &arg, mir::TensorVariant &result) |
void | Reshape (const mir::TensorVariant &input, mir::TensorVariant &output) |
void | Sigmoid (const mir::TensorVariant &arg, mir::TensorVariant &result) |
void | Slice (const mir::TensorVariant &arg, const mir::Shape &starts, mir::TensorVariant &res) |
void | Softmax (const mir::TensorVariant &arg, int axis, mir::TensorVariant &result) |
void | Sqrt (const mir::TensorVariant &arg, mir::TensorVariant &result) |
void | Sub (const TensorVariant &lhs, const TensorVariant &rhs, TensorVariant &res) |
void | Tanh (const mir::TensorVariant &arg, mir::TensorVariant &result) |
void | Transpose (const mir::TensorVariant &input, const mir::ops::TransposeOp &op, mir::TensorVariant &output) |
void mir_interpreter::Abs | ( | const mir::TensorVariant & | arg, |
mir::TensorVariant & | result | ||
) |
Definition at line 50 of file Abs.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Add | ( | const TensorVariant & | lhs, |
const TensorVariant & | rhs, | ||
TensorVariant & | res | ||
) |
Definition at line 121 of file Add.cpp.
References mir::TensorVariant::getElementType().
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::AvgPool2D | ( | const mir::ops::AvgPool2DOp & | op, |
const mir::TensorVariant & | input, | ||
mir::TensorVariant & | output | ||
) |
Definition at line 167 of file AvgPool2D.cpp.
void mir_interpreter::CappedReLU | ( | const mir::TensorVariant & | arg, |
float | cap, | ||
mir::TensorVariant & | result | ||
) |
Definition at line 77 of file CappedReLU.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Concat | ( | const std::vector< std::reference_wrapper< const mir::TensorVariant > > & | inputs, |
int | axis, | ||
mir::TensorVariant & | output | ||
) |
Definition at line 166 of file Concat.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Conv2D | ( | const mir::TensorVariant & | input, |
const mir::TensorVariant & | kernel, | ||
const mir::Conv2DOpAttributes & | attributes, | ||
mir::TensorVariant & | result, | ||
const mir::TensorVariant * | fused_bias | ||
) |
Definition at line 254 of file Conv2D.cpp.
References Conv2D().
Referenced by Conv2D(), and mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::DeConv2D | ( | const mir::TensorVariant & | input, |
const mir::TensorVariant & | kernel, | ||
const mir::Deconv2DOpAttributes & | attributes, | ||
mir::TensorVariant & | output | ||
) |
Transposed convolution (or Deconvolution)
input | The Input tensor |
op | The DeConvolution operation object |
This is basically the backward pass for the convolution operation, hence all the indexing can be deducted by expressing the input index of Conv in terms of it's output index.
Definition at line 116 of file DeConv2D.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::DepthwiseConv2D | ( | const mir::ops::DepthwiseConv2DOp & | op, |
const mir::TensorVariant & | input, | ||
const mir::TensorVariant & | kernel, | ||
mir::TensorVariant & | output, | ||
const mir::TensorVariant * | bias | ||
) |
Definition at line 218 of file DepthwiseConv2D.cpp.
void mir_interpreter::Dequantize | ( | const TensorVariant & | input, |
TensorVariant & | output | ||
) |
Definition at line 28 of file Quantization.cpp.
References mir::Tensor< T >::at(), mir::TensorType::getElementType(), mir::TensorType::getQuantization(), mir::AffineQuantization::getScale(), mir::AffineQuantization::getZeroPoint(), and mir::TensorType::isQuantized().
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::dispatch | ( | mir::DataType | dt, |
Args &&... | args | ||
) |
Definition at line 30 of file Common.h.
void mir_interpreter::Div | ( | const TensorVariant & | lhs, |
const TensorVariant & | rhs, | ||
TensorVariant & | res | ||
) |
Definition at line 57 of file Div.cpp.
References mir::TensorVariant::getElementType().
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::ELU | ( | const mir::TensorVariant & | arg, |
float | alpha, | ||
mir::TensorVariant & | result | ||
) |
Definition at line 46 of file ELU.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Equal | ( | const TensorVariant & | lhs, |
const TensorVariant & | rhs, | ||
TensorVariant & | res | ||
) |
Definition at line 48 of file Equal.cpp.
References mir::TensorVariant::getElementType().
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::erase | ( | mir::TensorVariant & | tv | ) |
Definition at line 51 of file Common.h.
References mir::TensorVariant::atOffset(), mir::TensorVariant::getShape(), and mir::Shape::numElements().
void mir_interpreter::Fill | ( | mir::TensorVariant & | t, |
F | f | ||
) |
Definition at line 41 of file Fill.h.
References mir::TensorVariant::getElementType().
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::FullyConnected | ( | const mir::TensorVariant & | input, |
const mir::TensorVariant & | weights, | ||
const mir::ops::FullyConnectedOp & | op, | ||
mir::TensorVariant & | res, | ||
const mir::TensorVariant * | bias | ||
) |
Definition at line 208 of file FullyConnected.cpp.
References mir::TensorVariant::getElementType().
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Gather | ( | const TensorVariant & | data, |
const TensorVariant & | indices, | ||
const ops::GatherOp & | op, | ||
TensorVariant & | res | ||
) |
Definition at line 86 of file Gather.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Greater | ( | const TensorVariant & | lhs, |
const TensorVariant & | rhs, | ||
TensorVariant & | res | ||
) |
Definition at line 48 of file Greater.cpp.
References mir::TensorVariant::getElementType().
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::HardSwish | ( | const mir::TensorVariant & | input, |
mir::TensorVariant & | result | ||
) |
Definition at line 49 of file HardSwish.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::LeakyReLU | ( | const mir::TensorVariant & | arg, |
float | alpha, | ||
mir::TensorVariant & | result | ||
) |
Definition at line 44 of file LeakyReLU.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Less | ( | const TensorVariant & | lhs, |
const TensorVariant & | rhs, | ||
TensorVariant & | res | ||
) |
Definition at line 48 of file Less.cpp.
References mir::TensorVariant::getElementType().
Referenced by mir_interpreter::MIRInterpreter::visit().
|
inline |
Definition at line 85 of file QuantizationHelpers.h.
References MaskIfNonZero().
Referenced by RoundingDivideByPOT().
|
inline |
Definition at line 83 of file QuantizationHelpers.h.
References MaskIfNonZero().
Referenced by RoundingDivideByPOT().
|
inline |
Definition at line 75 of file QuantizationHelpers.h.
Referenced by MaskIfGreaterThan(), MaskIfLessThan(), and MaskIfZero().
|
inline |
void mir_interpreter::Max | ( | const TensorVariant & | lhs, |
const TensorVariant & | rhs, | ||
TensorVariant & | res | ||
) |
Definition at line 57 of file Max.cpp.
References mir::TensorVariant::getElementType().
void mir_interpreter::MaxPool2D | ( | const mir::TensorVariant & | input, |
const mir::ops::MaxPool2DOp & | op, | ||
mir::TensorVariant & | result | ||
) |
Definition at line 151 of file MaxPool2D.cpp.
void mir_interpreter::Mul | ( | const TensorVariant & | lhs, |
const TensorVariant & | rhs, | ||
TensorVariant & | res | ||
) |
Definition at line 56 of file Mul.cpp.
References mir::TensorVariant::getElementType().
Referenced by mir_interpreter::MIRInterpreter::visit().
|
inline |
Definition at line 108 of file QuantizationHelpers.h.
References RoundingDivideByPOT(), SaturatingRoundingDoublingHighMul(), and shift().
Referenced by mir_interpreter::DepthwiseConv2DImpl< uint8_t >::run(), mir_interpreter::FullyConnectedImpl< uint8_t >::run(), and mir_interpreter::Conv2DImpl< uint8_t >::run().
|
inline |
Definition at line 116 of file QuantizationHelpers.h.
References RoundingDivideByPOT(), and SaturatingRoundingDoublingHighMul().
Referenced by mir_interpreter::AddImpl< uint8_t >::run().
void mir_interpreter::Pad | ( | const mir::TensorVariant & | input, |
const mir::ops::PadOp & | op, | ||
mir::TensorVariant & | result | ||
) |
Implements PadOp for interpreter backend.
This operation pads a tensor according to the paddings you specify. For each dimension of input add values before and after of contents.
Definition at line 79 of file Pad.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Quantize | ( | const TensorVariant & | input, |
TensorVariant & | output | ||
) |
Definition at line 47 of file Quantization.cpp.
References mir::Tensor< T >::at().
Referenced by mir_interpreter::MIRInterpreter::visit().
|
inline |
Definition at line 27 of file QuantizationHelpers.h.
References shift().
Referenced by QuantizeMultiplierSmallerThanOneExp(), mir_interpreter::DepthwiseConv2DImpl< uint8_t >::run(), mir_interpreter::FullyConnectedImpl< uint8_t >::run(), and mir_interpreter::Conv2DImpl< uint8_t >::run().
|
inline |
Definition at line 64 of file QuantizationHelpers.h.
References QuantizeMultiplier(), and shift().
Referenced by mir_interpreter::AddImpl< uint8_t >::run().
void mir_interpreter::ReduceMean | ( | const mir::TensorVariant & | input, |
const mir::ops::ReduceMeanOp & | op, | ||
mir::TensorVariant & | output | ||
) |
Definition at line 90 of file ReduceMean.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::ReLU | ( | const mir::TensorVariant & | arg, |
mir::TensorVariant & | result | ||
) |
Definition at line 53 of file ReLU.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Reshape | ( | const mir::TensorVariant & | input, |
mir::TensorVariant & | output | ||
) |
Definition at line 26 of file Reshape.cpp.
References mir::ShapeRange::begin().
Referenced by mir_interpreter::MIRInterpreter::visit(), and mir_interpreter::MIRInterpreter::visit().
|
inline |
Definition at line 87 of file QuantizationHelpers.h.
References MaskIfGreaterThan(), and MaskIfLessThan().
Referenced by MultiplyByQuantizedMultiplier(), and MultiplyByQuantizedMultiplierSmallerThanOneExp().
|
inline |
Definition at line 97 of file QuantizationHelpers.h.
Referenced by MultiplyByQuantizedMultiplier(), and MultiplyByQuantizedMultiplierSmallerThanOneExp().
mir::Index mir_interpreter::shift | ( | const Index & | in_index, |
const Shape & | shift_from | ||
) |
Definition at line 26 of file Common.cpp.
References mir::Shape::dim(), mir::Index::rank(), and mir::Shape::rank().
Referenced by MultiplyByQuantizedMultiplier(), QuantizeMultiplier(), QuantizeMultiplierSmallerThanOneExp(), and mir_interpreter::SliceImpl< T >::run().
void mir_interpreter::Sigmoid | ( | const mir::TensorVariant & | arg, |
mir::TensorVariant & | result | ||
) |
Definition at line 53 of file Sigmoid.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Slice | ( | const mir::TensorVariant & | arg, |
const mir::Shape & | starts, | ||
mir::TensorVariant & | res | ||
) |
Definition at line 47 of file Slice.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Softmax | ( | const mir::TensorVariant & | arg, |
int | axis, | ||
mir::TensorVariant & | result | ||
) |
Definition at line 150 of file Softmax.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Sqrt | ( | const mir::TensorVariant & | arg, |
mir::TensorVariant & | result | ||
) |
Definition at line 53 of file Sqrt.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Sub | ( | const TensorVariant & | lhs, |
const TensorVariant & | rhs, | ||
TensorVariant & | res | ||
) |
Definition at line 56 of file Sub.cpp.
References mir::TensorVariant::getElementType().
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Tanh | ( | const mir::TensorVariant & | arg, |
mir::TensorVariant & | result | ||
) |
Definition at line 53 of file Tanh.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().
void mir_interpreter::Transpose | ( | const mir::TensorVariant & | input, |
const mir::ops::TransposeOp & | op, | ||
mir::TensorVariant & | output | ||
) |
Definition at line 58 of file Transpose.cpp.
Referenced by mir_interpreter::MIRInterpreter::visit().