return id;
}
+// Restructure runtime_permutationVector to ACL_permutationVector
+::arm_compute::PermutationVector getARMComputePermutationVector(uint32_t rank,
+ const int32_t *runtime_pv)
+{
+ // rank upto 4 is supported
+ assert(rank <= 4);
+ assert(runtime_pv != nullptr);
+
+ int new_pv[4] = {0};
+ ::arm_compute::Coordinates axises = getARMComputeAxises(rank);
+
+ if (rank == 4)
+ {
+ /**
+ axises = {3,1,0,2}
+ NNAPI PermutationVector
+ N 0 3
+ H 1 1
+ W 2 0
+ C 3 2
+ **/
+ new_pv[0] = axises[runtime_pv[2]];
+ new_pv[1] = axises[runtime_pv[1]];
+ new_pv[2] = axises[runtime_pv[3]];
+ new_pv[3] = axises[runtime_pv[0]];
+ }
+ else
+ {
+ /**
+ mapping/axises = {rank-1 to 0}
+ CHW --------> WHC
+ or
+ WH ----------> HW
+ **/
+ for (int id = 0; id < rank; ++id)
+ {
+ new_pv[id] = axises[runtime_pv[rank - id - 1]];
+ }
+ }
+
+ return ::arm_compute::PermutationVector{new_pv[0], new_pv[1], new_pv[2], new_pv[3]};
+}
+
::arm_compute::TensorShape asTensorShape(const internal::tflite::operand::Shape &shape,
bool apply_dim_correction)
{
const ::arm_compute::Coordinates &axises);
/**
+* @brief Generate arm compute permutation vector from runtime permutation vector
+* @param[in] rank Rank number supported upto 4
+* @param[in] runtime_pv Integer array for runtime permutation vector
+* @return Permutation vector of arm compute
+*/
+::arm_compute::PermutationVector getARMComputePermutationVector(uint32_t rank,
+ const int32_t *runtime_pv);
+/**
* @brief Cast from shape of internal to arm compute
* @param[in] shape Internal shape object
* @param[in] apply_dim_correction Flag to state whether apply dimension correction after setting