#include <arm_compute/runtime/CL/functions/CLActivationLayer.h>
#include <arm_compute/runtime/CL/functions/CLScale.h>
#include <arm_compute/runtime/CL/functions/CLReshapeLayer.h>
+#include <arm_compute/runtime/CL/functions/CLStridedSlice.h>
#include <arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h>
#include <arm_compute/runtime/CL/functions/CLSoftmaxLayer.h>
void visit(const ::internal::tflite::op::ResizeBilinear::Node &node) override;
void visit(const ::internal::tflite::op::Reshape::Node &node) override;
void visit(const ::internal::tflite::op::Softmax::Node &node) override;
+ void visit(const ::internal::tflite::op::StridedSlice::Node &node) override;
void visit(const ::internal::tflite::op::Max::Node &node) override;
private:
_builder.addStage(stage);
}
+void Planner::visit(const ::internal::tflite::op::StridedSlice::Node &node)
+{
+ VERBOSE(StridedSlice) << "Configure STRIDED_SLICE operation" << std::endl;
+
+ throw std::runtime_error{"STRIDED_SLICE is not implemented yet"};
+}
+
void Planner::visit(const ::internal::tflite::op::Max::Node &node)
{
VERBOSE(Max) << "Configure MAX operation" << std::endl;
#include "internal/op/Concat.h"
#include "internal/op/Reshape.h"
#include "internal/op/ResizeBilinear.h"
+#include "internal/op/StridedSlice.h"
#include "internal/op/FullyConnected.h"
#include "internal/op/Softmax.h"
#include "internal/op/Max.h"
virtual void visit(const Concat::Node &) = 0;
virtual void visit(const Reshape::Node &) = 0;
virtual void visit(const ResizeBilinear::Node &) = 0;
+ virtual void visit(const StridedSlice::Node &) = 0;
virtual void visit(const FullyConnected::Node &) = 0;
virtual void visit(const Softmax::Node &) = 0;
virtual void visit(const Max::Node &) = 0;
--- /dev/null
+#include "internal/op/StridedSlice.h"
+#include "internal/op/NodeVisitor.h"
+
+#include <cassert>
+
+namespace internal
+{
+namespace tflite
+{
+namespace op
+{
+namespace StridedSlice
+{
+
+void Node::accept(NodeVisitor &&v) const { v.visit(*this); }
+
+} // namespace StridedSlice
+} // namespace op
+} // namespace tflite
+} // namespace internal
+
+namespace internal
+{
+namespace tflite
+{
+namespace op
+{
+namespace StridedSlice
+{
+
+Param::Param(uint32_t inputCount, const uint32_t *inputs, uint32_t outputCount,
+ const uint32_t *outputs)
+{
+ assert(inputCount == 2 && outputCount == 1);
+
+ outputData_index = outputs[0];
+
+ // Each input should be interpreted as follows:
+ //
+ // 0 -> An n-D tensor, specifying the tensor to be sliced.
+ // 1 -> A 1-D Tensor of {@link ANEURALNETWORKS_TENSOR_INT32}, the starts of
+ // the dimensions of the input tensor to be sliced. The length must be
+ // of rank(input0).
+ // 2 -> A 1-D Tensor of {@link ANEURALNETWORKS_TENSOR_INT32}, the ends of
+ // the dimensions of the input tensor to be sliced. The length must be
+ // of rank(input0).
+ // 3 -> A 1-D Tensor of {@link ANEURALNETWORKS_TENSOR_INT32}, the strides of
+ // the dimensions of the input tensor to be sliced. The length must be
+ // of rank(input0).
+ // 4 -> An {@link ANEURALNETWORKS_INT32} scalar, begin_mask. If the ith bit
+ // of begin_mask is set, begin[i] is ignored and the fullest possible
+ // range in that dimension is used instead.
+ // 5 -> An {@link ANEURALNETWORKS_INT32} scalar, end_mask. If the ith bit of
+ // end_mask is set, end[i] is ignored and the fullest possible range in
+ // that dimension is used instead.
+ // 6 -> An {@link ANEURALNETWORKS_INT32} scalar, shrink_axis_mask. An int32
+ // mask. If the ith bit of shrink_axis_mask is set, it implies that the
+ // ith specification shrinks the dimensionality by 1. A slice of size 1
+ // starting from begin[i] in the dimension must be preserved.
+ inputData_index = inputs[0];
+ startData_index = inputs[1];
+ endData_index = inputs[2];
+ stridesData_index = inputs[3];
+ beginMask_index = inputs[4];
+ endMask_index_index = inputs[5];
+ shrinkAxisMask_index = inputs[6];
+}
+
+} // namespace StridedSlice
+} // namespace op
+} // namespace tflite
+} // namespace internal
--- /dev/null
+#ifndef __INTERNAL_OP_STRIDEDSLICE_H__
+#define __INTERNAL_OP_STRIDEDSLICE_H__
+
+#include "internal/op/Node.h"
+
+#include <cstdint>
+
+namespace internal
+{
+namespace tflite
+{
+namespace op
+{
+namespace StridedSlice
+{
+
+struct Param
+{
+ int32_t outputData_index;
+
+ int32_t inputData_index;
+ int32_t startData_index;
+ int32_t endData_index;
+ int32_t stridesData_index;
+ int32_t beginMask_index;
+ int32_t endMask_index_index;
+ int32_t shrinkAxisMask_index;
+
+ Param() = default;
+ Param(uint32_t inputCount, const uint32_t *inputs, uint32_t outputCount, const uint32_t *outputs);
+};
+
+class Node final : public op::Node
+{
+public:
+ Node(const Param ¶m) : _param(param)
+ {
+ // DO NOTHING
+ }
+
+public:
+ virtual ~Node() = default;
+
+public:
+ const Param ¶m(void) const { return _param; }
+
+public:
+ void accept(NodeVisitor &&) const override;
+
+private:
+ const Param _param;
+};
+
+} // namespace StridedSlice
+} // namespace op
+} // namespace tflite
+} // namespace internal
+
+#endif // __INTERNAL_OP_STRIDEDSLICE_H__