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

Function operator==

arm_compute/core/QuantizationInfo.h:204–218  ·  view source on GitHub ↗

Check whether two quantization info are equal. * * @param[in] lhs RHS quantization info. * @param[in] rhs LHS quantization info. * * @return True if the given quantization info is the same. */

Source from the content-addressed store, hash-verified

202 * @return True if the given quantization info is the same.
203 */
204inline bool operator==(const QuantizationInfo &lhs, const QuantizationInfo &rhs)
205{
206 const bool lhs_is_uniform = lhs.scale().size() < 2 && lhs.offset().size() < 2;
207 const bool rhs_is_uniform = rhs.scale().size() < 2 && rhs.offset().size() < 2;
208
209 if (lhs_is_uniform && rhs_is_uniform)
210 {
211 const auto lhs_qinfo = lhs.uniform();
212 const auto rhs_qinfo = rhs.uniform();
213
214 return (lhs_qinfo.scale == rhs_qinfo.scale) && (lhs_qinfo.offset == rhs_qinfo.offset);
215 }
216
217 return (lhs.scale() == rhs.scale()) && (lhs.offset() == rhs.offset());
218}
219
220/** Check whether two quantization info are not equal.
221 *

Callers

nothing calls this directly

Calls 4

scaleMethod · 0.80
offsetMethod · 0.80
sizeMethod · 0.45
uniformMethod · 0.45

Tested by

no test coverage detected