MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / compute_permutation_parameters

Function compute_permutation_parameters

utils/GraphUtils.cpp:46–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44namespace
45{
46std::pair<arm_compute::TensorShape, arm_compute::PermutationVector>
47compute_permutation_parameters(const arm_compute::TensorShape &shape, arm_compute::DataLayout data_layout)
48{
49 // Set permutation parameters if needed
50 arm_compute::TensorShape permuted_shape = shape;
51 arm_compute::PermutationVector perm;
52 // Permute only if num_dimensions greater than 2
53 if (shape.num_dimensions() > 2)
54 {
55 perm = (data_layout == arm_compute::DataLayout::NHWC) ? arm_compute::PermutationVector(2U, 0U, 1U)
56 : arm_compute::PermutationVector(1U, 2U, 0U);
57
58 arm_compute::PermutationVector perm_shape = (data_layout == arm_compute::DataLayout::NCHW)
59 ? arm_compute::PermutationVector(2U, 0U, 1U)
60 : arm_compute::PermutationVector(1U, 2U, 0U);
61 arm_compute::permute(permuted_shape, perm_shape);
62 }
63
64 return std::make_pair(permuted_shape, perm);
65}
66} // namespace
67
68TFPreproccessor::TFPreproccessor(float min_range, float max_range) : _min_range(min_range), _max_range(max_range)

Callers 1

access_tensorMethod · 0.85

Calls 2

permuteFunction · 0.50
num_dimensionsMethod · 0.45

Tested by

no test coverage detected