{
int ifm_index;
- internal::tflite::operand::Shape shape{1};
+ ::neurun::internal::operand::Shape shape{1};
};
Param param;
{
int ofm_index;
- internal::tflite::operand::Shape shape{1};
+ ::neurun::internal::operand::Shape shape{1};
};
Param param;
int ker_index;
int bias_index;
- ::internal::tflite::operand::Shape ofm_shape{1};
- ::internal::tflite::operand::Shape ifm_shape{1};
- ::internal::tflite::operand::Shape ker_shape{1};
- ::internal::tflite::operand::Shape bias_shape{1};
+ ::neurun::internal::operand::Shape ofm_shape{1};
+ ::neurun::internal::operand::Shape ifm_shape{1};
+ ::neurun::internal::operand::Shape ker_shape{1};
+ ::neurun::internal::operand::Shape bias_shape{1};
::internal::Padding padding;
::internal::Stride stride;
uint32_t kw;
uint32_t kh;
- ::internal::tflite::operand::Shape ofm_shape{1};
- ::internal::tflite::operand::Shape ifm_shape{1};
+ ::neurun::internal::operand::Shape ofm_shape{1};
+ ::neurun::internal::operand::Shape ifm_shape{1};
::internal::Padding padding;
::internal::Stride stride;
uint32_t kw;
uint32_t kh;
- ::internal::tflite::operand::Shape ofm_shape{1};
- ::internal::tflite::operand::Shape ifm_shape{1};
+ ::neurun::internal::operand::Shape ofm_shape{1};
+ ::neurun::internal::operand::Shape ifm_shape{1};
::internal::Padding padding;
::internal::Stride stride;
int32_t axis;
- ::internal::tflite::operand::Shape ofm_shape{1};
- std::vector<::internal::tflite::operand::Shape> ifm_shapes;
+ ::neurun::internal::operand::Shape ofm_shape{1};
+ std::vector<::neurun::internal::operand::Shape> ifm_shapes;
};
Param param;
int weight_index;
int bias_index;
- ::internal::tflite::operand::Shape ofm_shape{1};
- ::internal::tflite::operand::Shape ifm_shape{1};
- ::internal::tflite::operand::Shape weight_shape{1};
- ::internal::tflite::operand::Shape bias_shape{1};
+ ::neurun::internal::operand::Shape ofm_shape{1};
+ ::neurun::internal::operand::Shape ifm_shape{1};
+ ::neurun::internal::operand::Shape weight_shape{1};
+ ::neurun::internal::operand::Shape bias_shape{1};
FuseCode activation;
};
int output_index;
int input_index;
- ::internal::tflite::operand::Shape ofm_shape{1};
- ::internal::tflite::operand::Shape ifm_shape{1};
+ ::neurun::internal::operand::Shape ofm_shape{1};
+ ::neurun::internal::operand::Shape ifm_shape{1};
};
Param param;
int output_index;
int input_index;
- ::internal::tflite::operand::Shape ofm_shape{1};
- ::internal::tflite::operand::Shape ifm_shape{1};
+ ::neurun::internal::operand::Shape ofm_shape{1};
+ ::neurun::internal::operand::Shape ifm_shape{1};
float scale;
};
{
int ifm_index;
- internal::tflite::operand::Shape shape{1};
+ ::neurun::internal::operand::Shape shape{1};
};
Param param;
{
int ofm_index;
- internal::tflite::operand::Shape shape{1};
+ ::neurun::internal::operand::Shape shape{1};
};
Param param;
return ANEURALNETWORKS_BAD_DATA;
}
- internal::tflite::operand::Shape shape(type->dimensionCount);
+ ::neurun::internal::operand::Shape shape(type->dimensionCount);
for (uint32_t axis = 0; axis < type->dimensionCount; ++axis)
{
return ANEURALNETWORKS_BAD_DATA;
}
- using internal::tflite::operand::CachedData;
+ using ::neurun::internal::operand::CachedData;
model->deref().setOperandValue(
ind, nnfw::make_unique<CachedData>(reinterpret_cast<const uint8_t *>(buffer), length));
return ANEURALNETWORKS_BAD_DATA;
}
- using internal::tflite::operand::ExternalData;
+ using ::neurun::internal::operand::ExternalData;
model->deref().setOperandValue(
ind, nnfw::make_unique<ExternalData>(
namespace graph
{
-operand::Index Graph::addOperand(const ::internal::tflite::operand::Shape &shape)
+operand::Index Graph::addOperand(const ::neurun::internal::operand::Shape &shape)
{
assert(_phase == Phase::BUILDING);
return _operands.append(shape);
}
void Graph::setOperandValue(const operand::Index &ind,
- std::unique_ptr<::internal::tflite::operand::Data> &&data)
+ std::unique_ptr<::neurun::internal::operand::Data> &&data)
{
assert(_phase == Phase::BUILDING);
assert(_operands.exist(ind));
// Graph Building
public:
- operand::Index addOperand(const ::internal::tflite::operand::Shape &shape);
+ operand::Index addOperand(const ::neurun::internal::operand::Shape &shape);
operation::Index addOperation(std::unique_ptr<operation::Node> &&node);
void setOperandValue(const operand::Index &ind,
- std::unique_ptr<::internal::tflite::operand::Data> &&data);
+ std::unique_ptr<::neurun::internal::operand::Data> &&data);
void addInput(const operand::Index &ind);
void addOutput(const operand::Index &ind);
void finishBuilding(void);
namespace operand
{
-Index Set::append(const ::internal::tflite::operand::Shape &shape)
+Index Set::append(const ::neurun::internal::operand::Shape &shape)
{
uint32_t index = _objects.size();
- _objects.emplace_back(new ::internal::tflite::operand::Object{shape});
+ _objects.emplace_back(new ::neurun::internal::operand::Object{shape});
return Index{index};
}
-const ::internal::tflite::operand::Object &Set::at(const Index &index) const
+const ::neurun::internal::operand::Object &Set::at(const Index &index) const
{
return *(_objects.at(index.asInt()));
}
-::internal::tflite::operand::Object &Set::at(const Index &index)
+::neurun::internal::operand::Object &Set::at(const Index &index)
{
return *(_objects.at(index.asInt()));
}
Set() = default;
public:
- Index append(const ::internal::tflite::operand::Shape &);
+ Index append(const ::neurun::internal::operand::Shape &);
public:
- const ::internal::tflite::operand::Object &at(const Index &) const;
- ::internal::tflite::operand::Object &at(const Index &);
+ const ::neurun::internal::operand::Object &at(const Index &) const;
+ ::neurun::internal::operand::Object &at(const Index &);
bool exist(const Index &) const;
private:
- std::vector<std::unique_ptr<::internal::tflite::operand::Object>> _objects;
+ std::vector<std::unique_ptr<::neurun::internal::operand::Object>> _objects;
};
} // namespace operand
#include <algorithm>
-namespace internal
+namespace neurun
{
-namespace tflite
+namespace internal
{
namespace operand
{
};
} // namespace operand
-} // namespace tflite
} // namespace internal
+} // namespace neurun
#endif // __NEURUN_INTERNAL_OPERAND_DATA_H__
#include "Object.h"
-namespace internal
+namespace neurun
{
-namespace tflite
+namespace internal
{
namespace operand
{
}
} // namespace operand
-} // namespace tflite
} // namespace internal
+} // namespace neurun
#include "Shape.h"
#include "Data.h"
-namespace internal
+namespace neurun
{
-namespace tflite
+namespace internal
{
namespace operand
{
};
} // namespace operand
-} // namespace tflite
} // namespace internal
+} // namespace neurun
#endif // __NEURUN_INTERNAL_OPERAND_OBJECT_H__
#include "internal/operand/Shape.h"
-namespace internal
+namespace neurun
{
-namespace tflite
+namespace internal
{
namespace operand
{
}
} // namespace operand
-} // namespace tflite
} // namespace internal
+} // namespace neurun
#include "util/feature/Shape.h"
#include "util/kernel/Shape.h"
-namespace internal
+namespace neurun
{
-namespace tflite
+namespace internal
{
namespace operand
{
};
} // namespace operand
-} // namespace tflite
} // namespace internal
+} // namespace neurun
#endif // __NEURUN_INTERNAL_OPERAND_SHAPE_H__
void TensorConvertFromCommonLayer::configure(::internal::common::Tensor *inputTensor,
::arm_compute::ICLTensor *outputTensor,
- const ::internal::tflite::operand::Shape &tensorShape)
+ const ::neurun::internal::operand::Shape &tensorShape)
{
_inputTensor = inputTensor;
_outputTensor = outputTensor;
bool convert();
void configure(::internal::common::Tensor *inputTensor, ::arm_compute::ICLTensor *outputTensor,
- const ::internal::tflite::operand::Shape &tensorShape);
+ const ::neurun::internal::operand::Shape &tensorShape);
void run();
::internal::common::Tensor *_inputTensor;
::arm_compute::ICLTensor *_outputTensor;
- ::internal::tflite::operand::Shape _tensorShape{1};
+ ::neurun::internal::operand::Shape _tensorShape{1};
};
} // namespace acl_cl
void TensorConvertToCommonLayer::configure(::arm_compute::ICLTensor *inputTensor,
::internal::common::Tensor *outputTensor,
- const ::internal::tflite::operand::Shape &tensorShape)
+ const ::neurun::internal::operand::Shape &tensorShape)
{
_inputTensor = inputTensor;
_outputTensor = outputTensor;
bool convert();
void configure(::arm_compute::ICLTensor *inputTensor, ::internal::common::Tensor *outputTensor,
- const ::internal::tflite::operand::Shape &tensorShape);
+ const ::neurun::internal::operand::Shape &tensorShape);
void run();
::arm_compute::ICLTensor *_inputTensor;
::internal::common::Tensor *_outputTensor;
- ::internal::tflite::operand::Shape _tensorShape{1};
+ ::neurun::internal::operand::Shape _tensorShape{1};
};
} // namespace acl_cl
return true;
}
-void AvgPoolLayer::configure(uint8_t *inputData, const internal::tflite::operand::Shape inputShape,
+void AvgPoolLayer::configure(uint8_t *inputData,
+ const ::neurun::internal::operand::Shape inputShape,
const uint32_t paddingLeft, const uint32_t paddingRight,
const uint32_t paddingTop, const uint32_t paddingBottom,
const uint32_t strideWidth, const uint32_t strideHeight,
const uint32_t kernelWidth, const uint32_t kernelHeight,
const FuseCode activation, uint8_t *outputData,
- const internal::tflite::operand::Shape outputShape)
+ const ::neurun::internal::operand::Shape outputShape)
{
_inputData = inputData;
_inputShape = convertShape(inputShape);
bool averagePoolQuant8();
- void configure(uint8_t *inputData, const internal::tflite::operand::Shape inputShape,
+ void configure(uint8_t *inputData, const ::neurun::internal::operand::Shape inputShape,
const uint32_t paddingLeft, const uint32_t paddingRight, const uint32_t paddingTop,
const uint32_t paddingBottom, const uint32_t strideWidth,
const uint32_t strideHeight, const uint32_t kernelWidth,
const uint32_t kernelHeight, const FuseCode activation, uint8_t *outputData,
- const internal::tflite::operand::Shape outputShape);
+ const ::neurun::internal::operand::Shape outputShape);
void run();
}
void ConcatLayer::configure(const std::vector<const uint8_t *> &inputDataPtrs,
- const std::vector<internal::tflite::operand::Shape> &inputShapes,
+ const std::vector<::neurun::internal::operand::Shape> &inputShapes,
int32_t axis, uint8_t *outputData,
- const internal::tflite::operand::Shape outputShape)
+ const ::neurun::internal::operand::Shape outputShape)
{
_inputDataPtrs = inputDataPtrs;
bool concatenationQuant8();
void configure(const std::vector<const uint8_t *> &inputDataPtrs,
- const std::vector<internal::tflite::operand::Shape> &inputShapes, int32_t axis,
- uint8_t *outputData, const internal::tflite::operand::Shape outputShape);
+ const std::vector<::neurun::internal::operand::Shape> &inputShapes, int32_t axis,
+ uint8_t *outputData, const ::neurun::internal::operand::Shape outputShape);
void run();
}
void ConvolutionLayer::configure(
- uint8_t *inputData, const internal::tflite::operand::Shape inputShape, uint8_t *kernelData,
- const internal::tflite::operand::Shape kernelShape, uint8_t *biasData,
- const internal::tflite::operand::Shape biasShape, const uint32_t paddingLeft,
+ uint8_t *inputData, const ::neurun::internal::operand::Shape inputShape, uint8_t *kernelData,
+ const ::neurun::internal::operand::Shape kernelShape, uint8_t *biasData,
+ const ::neurun::internal::operand::Shape biasShape, const uint32_t paddingLeft,
const uint32_t paddingRight, const uint32_t paddingTop, const uint32_t paddingBottom,
const uint32_t strideWidth, const uint32_t strideHeight, const FuseCode activation,
- uint8_t *outputData, const internal::tflite::operand::Shape outputShape)
+ uint8_t *outputData, const ::neurun::internal::operand::Shape outputShape)
{
_inputData = inputData;
_inputShape = convertShape(inputShape);
bool convQuant8();
- void configure(uint8_t *inputData, const internal::tflite::operand::Shape inputShape,
- uint8_t *kernelData, const internal::tflite::operand::Shape kernelShape,
- uint8_t *biasData, const internal::tflite::operand::Shape biasShape,
+ void configure(uint8_t *inputData, const ::neurun::internal::operand::Shape inputShape,
+ uint8_t *kernelData, const ::neurun::internal::operand::Shape kernelShape,
+ uint8_t *biasData, const ::neurun::internal::operand::Shape biasShape,
const uint32_t paddingLeft, const uint32_t paddingRight, const uint32_t paddingTop,
const uint32_t paddingBottom, const uint32_t strideW, const uint32_t strideH,
const FuseCode activation, uint8_t *outputData,
- const internal::tflite::operand::Shape outputShape);
+ const ::neurun::internal::operand::Shape outputShape);
void run();
}
void FullyConnectedLayer::configure(
- uint8_t *inputData, const internal::tflite::operand::Shape inputShape, uint8_t *weightsData,
- const internal::tflite::operand::Shape weightsShape, uint8_t *biasData,
- const internal::tflite::operand::Shape biasShape, FuseCode activation, uint8_t *outputData,
- const internal::tflite::operand::Shape outputShape)
+ uint8_t *inputData, const ::neurun::internal::operand::Shape inputShape, uint8_t *weightsData,
+ const ::neurun::internal::operand::Shape weightsShape, uint8_t *biasData,
+ const ::neurun::internal::operand::Shape biasShape, FuseCode activation, uint8_t *outputData,
+ const ::neurun::internal::operand::Shape outputShape)
{
_inputData = inputData;
_inputShape = convertShape(inputShape);
bool fullyConnectedQuant8();
- void configure(uint8_t *inputData, const internal::tflite::operand::Shape inputShape,
- uint8_t *weightsData, const internal::tflite::operand::Shape weightsShape,
- uint8_t *biasData, const internal::tflite::operand::Shape biasShape,
+ void configure(uint8_t *inputData, const ::neurun::internal::operand::Shape inputShape,
+ uint8_t *weightsData, const ::neurun::internal::operand::Shape weightsShape,
+ uint8_t *biasData, const ::neurun::internal::operand::Shape biasShape,
FuseCode activation, uint8_t *outputData,
- const internal::tflite::operand::Shape outputShape);
+ const ::neurun::internal::operand::Shape outputShape);
void run();
return true;
}
-void MaxPoolLayer::configure(uint8_t *inputData, const internal::tflite::operand::Shape inputShape,
+void MaxPoolLayer::configure(uint8_t *inputData,
+ const ::neurun::internal::operand::Shape inputShape,
const uint32_t paddingLeft, const uint32_t paddingRight,
const uint32_t paddingTop, const uint32_t paddingBottom,
const uint32_t strideWidth, const uint32_t strideHeight,
const uint32_t kernelWidth, const uint32_t kernelHeight,
const FuseCode activation, uint8_t *outputData,
- const internal::tflite::operand::Shape outputShape)
+ const ::neurun::internal::operand::Shape outputShape)
{
_inputData = inputData;
_inputShape = convertShape(inputShape);
bool maxPoolQuant8();
- void configure(uint8_t *inputData, const internal::tflite::operand::Shape inputShape,
+ void configure(uint8_t *inputData, const ::neurun::internal::operand::Shape inputShape,
const uint32_t paddingLeft, const uint32_t paddingRight, const uint32_t paddingTop,
const uint32_t paddingBottom, const uint32_t strideWidth,
const uint32_t strideHeight, const uint32_t kernelWidth,
const uint32_t kernelHeight, const FuseCode activation, uint8_t *outputData,
- const internal::tflite::operand::Shape outputShape);
+ const ::neurun::internal::operand::Shape outputShape);
void run();
return static_cast<int32_t>(std::floor(max_input_rescaled));
}
-Shape convertShape(const ::internal::tflite::operand::Shape &o)
+Shape convertShape(const ::neurun::internal::operand::Shape &o)
{
Shape shape;
int32_t CalculateInputRadius(int input_integer_bits, int input_left_shift);
-Shape convertShape(const ::internal::tflite::operand::Shape &o);
+Shape convertShape(const ::neurun::internal::operand::Shape &o);
uint32_t sizeOfData(OperandType type, const std::vector<uint32_t> &dimensions);
return true;
}
-void ReshapeLayer::configure(uint8_t *inputData, const internal::tflite::operand::Shape &inputShape,
+void ReshapeLayer::configure(uint8_t *inputData,
+ const ::neurun::internal::operand::Shape &inputShape,
uint8_t *outputData,
- const internal::tflite::operand::Shape &outputShape)
+ const ::neurun::internal::operand::Shape &outputShape)
{
_inputData = inputData;
_inputShape = convertShape(inputShape);
public:
bool reshapeGeneric();
- void configure(uint8_t *inputData, const internal::tflite::operand::Shape &inputShape,
- uint8_t *outputData, const internal::tflite::operand::Shape &outputShape);
+ void configure(uint8_t *inputData, const ::neurun::internal::operand::Shape &inputShape,
+ uint8_t *outputData, const ::neurun::internal::operand::Shape &outputShape);
void run();
}
void SoftMaxLayer::configure(uint8_t *inputData,
- const ::internal::tflite::operand::Shape &inputShape, const float beta,
+ const ::neurun::internal::operand::Shape &inputShape, const float beta,
uint8_t *outputData,
- const ::internal::tflite::operand::Shape &outputShape)
+ const ::neurun::internal::operand::Shape &outputShape)
{
_inputData = inputData;
_inputShape = convertShape(inputShape);
bool softmaxQuant8();
- void configure(uint8_t *inputData, const ::internal::tflite::operand::Shape &inputShape,
+ void configure(uint8_t *inputData, const ::neurun::internal::operand::Shape &inputShape,
const float beta, uint8_t *outputData,
- const ::internal::tflite::operand::Shape &outputShape);
+ const ::neurun::internal::operand::Shape &outputShape);
void run();
void TensorConvertFromCommonLayer::configure(::internal::common::Tensor *inputTensor,
::internal::cpu::Tensor *outputTensor,
- const ::internal::tflite::operand::Shape &tensorShape)
+ const ::neurun::internal::operand::Shape &tensorShape)
{
_inputTensor = inputTensor;
_outputTensor = outputTensor;
bool convert();
void configure(::internal::common::Tensor *inputTensor, ::internal::cpu::Tensor *outputTensor,
- const ::internal::tflite::operand::Shape &tensorShape);
+ const ::neurun::internal::operand::Shape &tensorShape);
void run();
::internal::common::Tensor *_inputTensor;
::internal::cpu::Tensor *_outputTensor;
- ::internal::tflite::operand::Shape _tensorShape{1};
+ ::neurun::internal::operand::Shape _tensorShape{1};
};
} // namespace cpu
void TensorConvertToCommonLayer::configure(::internal::cpu::Tensor *inputTensor,
::internal::common::Tensor *outputTensor,
- const ::internal::tflite::operand::Shape &tensorShape)
+ const ::neurun::internal::operand::Shape &tensorShape)
{
_inputTensor = inputTensor;
_outputTensor = outputTensor;
bool convert();
void configure(::internal::cpu::Tensor *inputTensor, ::internal::common::Tensor *outputTensor,
- const ::internal::tflite::operand::Shape &tensorShape);
+ const ::neurun::internal::operand::Shape &tensorShape);
void run();
::internal::cpu::Tensor *_inputTensor;
::internal::common::Tensor *_outputTensor;
- ::internal::tflite::operand::Shape _tensorShape{1};
+ ::neurun::internal::operand::Shape _tensorShape{1};
};
} // namespace cpu
{
neurun::graph::operand::Set set;
- internal::tflite::operand::Shape shape0{3};
+ ::neurun::internal::operand::Shape shape0{3};
shape0.dim(0) = 1;
shape0.dim(1) = 2;
shape0.dim(2) = 3;
- internal::tflite::operand::Shape shape1{4};
+ ::neurun::internal::operand::Shape shape1{4};
shape1.dim(0) = 10;
shape1.dim(1) = 20;
shape1.dim(2) = 30;
neurun::graph::Graph graph;
neurun::graph::verifier::DAGChecker verifier;
- internal::tflite::operand::Shape shape{1u};
+ ::neurun::internal::operand::Shape shape{1u};
shape.dim(0) = 3;
auto operand1 = graph.addOperand(shape);