Permutes a given tensor shape given the input and output data layout * * @param[in] tensor_shape Tensor shape to permute * @param[in] in_data_layout Input tensor shape data layout * @param[in] out_data_layout Output tensor shape data layout * * @return Permuted tensor shape */
| 671 | * @return Permuted tensor shape |
| 672 | */ |
| 673 | inline TensorShape permute_shape(TensorShape tensor_shape, DataLayout in_data_layout, DataLayout out_data_layout) |
| 674 | { |
| 675 | if (in_data_layout != out_data_layout) |
| 676 | { |
| 677 | arm_compute::PermutationVector perm_vec = (in_data_layout == DataLayout::NCHW) |
| 678 | ? arm_compute::PermutationVector(2U, 0U, 1U) |
| 679 | : arm_compute::PermutationVector(1U, 2U, 0U); |
| 680 | arm_compute::permute(tensor_shape, perm_vec); |
| 681 | } |
| 682 | return tensor_shape; |
| 683 | } |
| 684 | |
| 685 | /** Utility function to return the TargetHint |
| 686 | * |
no test coverage detected