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

Method validate

src/cpu/operators/CpuSoftmax.cpp:90–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90Status
91CpuSoftmaxGeneric::validate(const ITensorInfo *src, const ITensorInfo *dst, float beta, int32_t axis, bool is_log)
92{
93 ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuSoftmaxGeneric::validate");
94 // Perform validation step
95 ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src, dst);
96 ARM_COMPUTE_RETURN_ERROR_ON_MSG(src->num_dimensions() > 4, "Only up to 4 dimensions are supported");
97 ARM_COMPUTE_UNUSED(beta);
98 ARM_COMPUTE_RETURN_ERROR_ON(axis < static_cast<int32_t>(-src->num_dimensions()) ||
99 static_cast<int32_t>(src->num_dimensions()) <= axis);
100
101 // Create intermediate tensor info
102 TensorInfo tensor_info_tmp;
103
104 if (is_data_type_quantized_asymmetric(src->data_type()))
105 {
106 tensor_info_tmp = src->clone()->set_data_type(DataType::F32).set_is_resizable(true);
107 }
108 const unsigned int actual_axis =
109 static_cast<unsigned int>(wrap_around(axis, static_cast<int32_t>(src->num_dimensions())));
110
111 ARM_COMPUTE_RETURN_ON_ERROR(
112 kernels::CpuSoftmaxKernel::validate(src, dst, beta, actual_axis, is_log, &tensor_info_tmp));
113
114 return Status{};
115}
116
117void CpuSoftmaxGeneric::run(ITensorPack &tensors)
118{

Callers

nothing calls this directly

Calls 6

wrap_aroundFunction · 0.85
validateFunction · 0.50
num_dimensionsMethod · 0.45
data_typeMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected