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

Function validate_arguments

src/core/CPP/kernels/CPPPermuteKernel.cpp:41–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39namespace
40{
41Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, const PermutationVector &perm)
42{
43 ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, output);
44 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(input);
45 ARM_COMPUTE_RETURN_ERROR_ON(input->data_type() == DataType::UNKNOWN);
46 ARM_COMPUTE_RETURN_ERROR_ON_MSG(perm.num_dimensions() > 4, "Only up to 4D permutation vectors are supported");
47
48 const TensorShape output_shape = misc::shape_calculator::compute_permutation_output_shape(*input, perm);
49
50 // Validate configured output
51 if (output->total_size() != 0)
52 {
53 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(output);
54 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(output->tensor_shape(), output_shape);
55 ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
56 }
57 else
58 {
59 const auto output_info = TensorInfo(output_shape, input->num_channels(), input->data_type());
60 ARM_COMPUTE_RETURN_ERROR_ON_SIZE_UNSUPPORTED(&output_info);
61 }
62
63 return Status{};
64}
65
66} // namespace
67

Callers 2

configureMethod · 0.70
validateMethod · 0.70

Calls 6

TensorInfoClass · 0.50
data_typeMethod · 0.45
num_dimensionsMethod · 0.45
total_sizeMethod · 0.45
num_channelsMethod · 0.45

Tested by

no test coverage detected